Floating point results change with different compilation options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi
   I use gcc compiler in order to study the behavior of some iterative
maps (x_n=f(x_{n-1})) using single floating point precision (following
IEEE 754 standard). I have noticed that using different compiler
options, the output sequence could be very different. My programs are
written in C++ using 'float' type and I use 'gcc version 4.1.2
20061115 (prerelease) (Debian 4.1.1-21)'. Compilation options are:
'-Wall -O3 -march=pentium4' or '-Wall'. The same program compiled with
gcc 4.2.2 gives the same results regardless of the compilation options
(on an athlon64 processor).
   Is this a bug of the compiler or the floating point representation
differs from one compiler version to the other?

-- 
Bogdan Cristea

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux