This is the mail archive of the gcc-help@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]

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


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