Am Tue, 02 Oct 2012 09:38:56 +0200 schrieb Don Clugston <d...@nospam.com>:
> Any code that behaves differently when compiled with -O, will do this as > well. Constant folding of floating point numbers does the same thing, if > the numbers are represented in the compiler in a different precision to > how the machine calculates them. I believe that GCC, for example, uses > very much higher precision (hundreds of bits) at compile time. I'm not an expert, but I would have thought compilers strive to be IEEE compliant - whatever that means in detail. I've seen a compression algorithm that relies on exact floating-point semantics and accuracy. It would just fail, if compilers were creative or lax at certain optimization levels. (excluding the "I know what I am doing -ffast-math.) -- Marco