I try to read a float in a string using sscanf or atof. It seems to work but then it's a bit strange when I manipulate the value obtained.
Expand|Select|Wrap|Line Numbers
- float fl;
- char str[]="1.43"
- fl=atof(str);
- printf("%f\n",floor(1000.0*fl) );
It seems to be due to the precision of the float type (Isn't it?).
Do you know how I can avoid that?
Regards