S32 Design studio

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

S32 Design studio

858 次查看
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 项奖励
回复
1 回复

807 次查看
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 项奖励
回复