problem with floats in conditional statements
Code:
#include<stdio.h>
int main()
{
float a=0.7;
if( a<0.7) //
printf("true\n");
else
printf("false\n");
}
here a=0.7 is not obviously less than 0.7...
Logically the output should be printed as "false", but its being printed as true...
i am not able to figure out the logic.. can somebody please tell me how the statement is interpreted...
- regards
Abhijith
that got posted accidently...
sorry.. didnt realize that it got published...
will take care next time while posting..
sorry once again.. :(