Rounding Error

Alexandre Oliva oliva@dcc.unicamp.br
Thu Sep 17 11:25:00 GMT 1998


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

> (int)(1/0.001) -> 999
> (int)(1/0.01) -> 99
> (int)(1/0.1) -> 9

> Now, Is this a problem in glibc, egcs, or the Pentium II hardware?

It's just rounding error.

-- 
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