i have checked the code in broland 4.5..

i have changed some code and checked ...


int main()
{
*float a=275.6;*
printf("%.10f\n",a);//prints 275.7000122070 WHY???
if(275.7>a)
 printf("Hi");
else
 printf("Hello");
return 0;
}

output is 275.6000061035


and also look at this one as well..


int main()
{
*float a=275.5;*
printf("%.10f\n",a);//prints 275.7000122070 WHY???
if(275.7>a)
 printf("Hi");
else
 printf("Hello");
return 0;
}

output is 275.5000000000

if the value is less than* .5 * it is showing 

int main()
{
float a=275.4;
printf("%.10f\n",a);//prints 275.7000122070 WHY???
if(275.7>a)
 printf("Hi");
else
 printf("Hello");
return 0;
}

output is 275.39999938965..

but i dont know the reason..

can any one explain the reason...


-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/XmH20-6J0ecJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to