Meaning of Float>>closeTo:

Damien Cassou damien.cassou at gmail.com
Fri Mar 2 12:56:34 UTC 2007


2007/3/2, Bert Freudenberg <bert at freudenbergs.de>:
> On Mar 2, 2007, at 12:55 , Damien Cassou wrote:
> > 999999 closeTo: 999899.00011.             => true
> > 999999 closeTo: 999899.0001.               => false
> >
> > Is it a bug ? Is it a problem with how computer deal with floating
> > point numbers ?
>
> No, one is just closer than the other. One is below the threshold and
> one above.

I don't understand. We are talking about 2 numbers close to 1 million.
I don't see how adding 0.00001 to one number can totally change the
result.

-- 
Damien Cassou



More information about the Squeak-dev mailing list