EmbLogic's Blog

floating point number

why the floating point number initialising with f in postfix……….

e.g.

if we take two floating point number

f1 = 0.5f;

f2 = 0.3f;

and if we print, then two different result

if( f1 == 0.5f )

{

printf(“f1 = %f\n”,f1);

printf(“True”);

}

else

printf(“False”);

//case 2

if( f2 == 0.3f )

{

printf(“f2 = %f\n”,f2);

printf(“True”);

}

else

printf(“False”);

 

the above two if case give two different result…….

understand if no just wait for next  ……

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>