Rounding Error

Alexandre Oliva oliva@dcc.unicamp.br
Thu Sep 17 12:58:00 GMT 1998


Eric Mercer <eemercer@yuan.elen.utah.edu> writes:

>    4) If you assign the result to a temporary double and then typecast
>       the temporary double, you get the correct answer.

Here's the key point.  The FP unit of i586 and higher represents
floating-point numbers with higher precision than doubles, and this
may affect the results of the computation depending on whether
intermediate values are spilled to stack slots or kept in FP
registers.  Perhaps -ffloat-store helps...

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil




More information about the Gcc-bugs mailing list