S32 Design studio

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32 Design studio

896 Views
prabhus
Contributor II

Hi ,

i m currently working on S32K144 development board. working odo meter calculation i m facing some problem .

test_variable_sfp reached 16384 after that variable not updating .it always showing 16384

#include <stdio.h>

float test_variable_sfp = 16380.0;
int main()
{
while(1)
{
test_variable_sfp += 0.000493264059;
//test_variable_sfp += 0.000493;
printf("test %f\r\n",test_variable_sfp);
}

return 0;
}

 

 

0 Kudos
Reply
1 Reply

845 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@prabhus

This has nothing to do with S32 Design Studio, this is a single precision floating point error problem.

Senlent_0-1694415535218.png

 

0 Kudos
Reply