Go Down

Topic: What's the mean of "f" in this Code (Read 764 times) previous topic - next topic

mamette

Hi, i found this code on the internet:

Code: [Select]
#define Kp 2.0f // proportional gain governs rate of convergence to accelerometer/magnetometer
#define Ki 0.005f // integral gain governs rate of convergence of gyroscope biases
#define halfT 0.5f // half the sample period


Wahat the mean of "f" at 2.0f, 0.005f, and 0.5f?

pylon

Possibly "float" but it depends how the definitions are used later on. In this code it's just definition for the precompiler.

mamette


Possibly "float" but it depends how the definitions are used later on. In this code it's just definition for the precompiler.


How if i deleted "f" and just use the number? I found many definition like this, for example:

Code: [Select]
#define GRAVITY 16384.0f
#define SCALE_PID_PARAMS 1000.0f


But i still confused what is the mean of "f"..

pYro_65

#3
May 23, 2013, 09:04 am Last Edit: May 23, 2013, 09:06 am by pYro_65 Reason: 1
This has a good answer, there are links to relevant info:
http://stackoverflow.com/questions/4828167/purpose-of-a-f-appended-to-a-number

mamette


This has a good answer, there are links to relevant info:
http://stackoverflow.com/questions/4828167/purpose-of-a-f-appended-to-a-number


Great..
Thank You..

pYro_65

No worries, remember stack overflow, it has a lot of great non-Arduino answers ( arduino stuff too ).

Go Up