This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Rounding Error
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