This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: floating point bug -- or misunderstanding?


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]