S32 Design studio

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32 Design studio

873件の閲覧回数
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 返信

822件の閲覧回数
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 件の賞賛
返信