Can anyone tell me, how to compare two floats…??
Can anyone tell me, how to compare two floats…??
EmbLogic Research & Competency Development Labs
Phone: +91 9818467776, 8527567776, 9650467776
Email: info@emblogic.com
Copyright © EmbLogic Embedded Technologies Pvt. Ltd.
you can compare as follows instead of using ‘==’ operator
float a=2.56576;
float b=2.56575;
if(a-b<0.00001)
printf("b is graeter");
else
printf("a is greater");
return 0;