This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Bug


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]