This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: floating point bug -- or misunderstanding?
- To: Derrick Bass <derrick at tapir dot Caltech dot EDU>
- Subject: Re: floating point bug -- or misunderstanding?
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 14 Aug 1998 15:28:05 -0300
- Cc: egcs-bugs at cygnus dot com
- References: <199808141600.JAA08249@lenny.tapir.Caltech.EDU>
Derrick Bass <derrick@tapir.Caltech.EDU> writes:
> I may have found a bug in egcs, but more likely I just don't
> understand floating point math.
The x86 FPU works with an internal precision higher than the one
offered by type double. Thus, when it performs calculations
internally, without storing temporary values in memory, it usually
gets more accurate results than if it stores and loads values in
memory. Your program is just getting rounding errors.
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil