Part Number: LAUNCHXL-F28069M
Tool/software: Code Composer Studio
Dear Everyone,
I have a precision problem about float values.
#include "math.h"
is included. I defined 5 different types of float parameters to check how the process works.
float32 p1 = 1.1; float p2 = 1.1; float64 p3 = 1.2; double p4 = 1.3; long double p5 = 1.4;
The results of these float parameters are below :
When I give these "1.1" values from "Expressions" window, surely the result is the same.
Which means truncation will not work. I know that it is about how CCS: the 64-bit value in memory or many IEEE-754 data converters around translate the value.
What do you do in this kind of situations?
It won't make a huge difference for the calculations but while sending or receiving the values to/from a computer or hmi interface, it looks a bit weird. (I entered 1.1 but it shows me 1.10000002 etc.)
Thank you.


