Hi All,
I am programing a test FPM to get familiar with the iLON programming
enviroment. In this module I am passing a float data point
(sm_freqadjprice_temp ) from the Data Point view on the iLON home page
which is then read in by my FPM. I am then doing some simple checks eg.
if (sm_freqadjprice_temp == 49.1)
{
sm_FreqAdjPrice = 99.9;
}
else
{
sm_FreqAdjPrice = 11.1;
}
When
I entered 49.1 in the data point view I kept getting a return value of
11.1 (false) rather than 99.9 (true). As sm_freqadjprice_temp = 49.1
(49.1 == 49.1) the result should be true.
I decided to printf the value being read in from the data point view screen and I got strange results:
If I entered the following:
Entered Value being pass to program and onto printf
49.1 49.0999980
49.2 49.2000010
49.3 49.2999990 etc....
Also the same occurs if I let a float = 49.1 in code and the do a printf I get 49.0999980.
Have you ever seen a problem like this with Floats?
Thanks for the help.