This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Floating point results change with different compilation options
- From: John Love-Jensen <eljay at adobe dot com>
- To: Cristea Bogdan <cristeab at gmail dot com>, MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Tue, 23 Oct 2007 06:41:27 -0500
- Subject: Re: Floating point results change with different compilation options
Hi Cristea,
> Is this a bug of the compiler...?
No. Certain optimizations can exacerbate code that poorly accommodates
float peculiarities.
> ...or the floating point representation differs from one compiler version to
the other?
No, not the representation. Probably the calculation.
The problem is one-or-both of:
+ not all hardware is compliant with IEEE 754 calculations
+ not all code is written carefully to accommodate float peculiarities
Please read the article What Every Computer Scientist Should Know About
Floating-Point Arithmetic, by David Goldberg (1991).
http://docs.sun.com/source/806-3568/ncg_goldberg.html
HTH,
--Eljay