Bug
Cavit Cahit VURAL
ccvural@ttnet.net.tr
Fri Jan 6 12:01:00 GMT 2006
Hi,
I am not sure is this a bug or not !.
Here is my code, very simple
///////////////////////////////////////////////////////////
#include <stdio.h>
int main ()
{
float a;
float b;
int i;
a = 10.97;
b = 0.0;
for (i=0; i < 30; i++) {
b = b + a;
}
printf ("a = %f , b = %f", a, b);
return (0);
}
//////////////////////////////////////////////
And the output :
a = 10.970000 , b = 329.100006
////////////////////////////////////////////
Why b is not just 329.1 ?
My gcc is gcc-3.4.4.
I tried both on DOS / DJGPP and Cygwin/WinXP
Any Idea or Solution ?
Regards
CC Vural
More information about the Gcc-bugs
mailing list