decimal calculation correction problem

Midway:
hi,

this is the code:

 #define MF 38.9

Na = Freq + MF;




When i run the software in the Nano, I see that the decimal MF is 38.9000015258 and not 38.9.

how can i decrease this "15258" to 38.9

i have tried to:


MFcorr = MF - 15258




but not work well


i appreciate all the help
ed

Simple: don't use floats. Use integer maths instead.

Instead of using the actual value, use the "milli" value. For instance, instead of volts (3.2V) use millivolts (3200mV). Instead of degrees C (25.6 DegC), use milliDegrees C (25600 mDegC). Instead of Hz (143.2Hz) use milliHertz (143200mHz)...