This is the mail archive of the
mailing list for the GCC project.
Floating poing 'non-bug'? Or is this a bug?
- From: "Yuval Kfir" <yuvalk at mainsoft dot com>
- To: <gcc at gcc dot gnu dot org>
- Date: Tue, 6 Jul 2004 10:34:51 +0300
- Subject: Floating poing 'non-bug'? Or is this a bug?
- Organization: Mainsoft Corporation Ltd.
I posted this to gcc-bugs but received no response, perhaps someone here can
The short program below gives '5*1.2=5' when compiled
without -DDOUBLE_INTER, but '5*1.2=6' with the double-precision intermediate
Is this the same old non-bug? Why would it behave differently when storing
the result temporarily in a double?
Yuval Kfir, Kernel team
int main (void)
int i = 5;
double g = i * 1.2;
i = g;
i *= 1.2;
printf("5 * 1.2 = %d?\n",i);