Go Down

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

#### mamette

##### Mar 12, 2013, 04:34 pm
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

#1
##### Mar 12, 2013, 04:39 pm
Possibly "float" but it depends how the definitions are used later on. In this code it's just definition for the precompiler.

#### mamette

#2
##### May 23, 2013, 09:01 am

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 amLast 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

#4
##### May 23, 2013, 10:15 am

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

#5
##### May 23, 2013, 10:37 am
No worries, remember stack overflow, it has a lot of great non-Arduino answers ( arduino stuff too ).

Go Up

Please enter a valid email to subscribe