Meaning of Float>>closeTo:
Frank Shearar
frank.shearar at angband.za.org
Fri Mar 2 14:02:15 UTC 2007
"Damien Cassou" <damien.cassou at gmail.com> wrote:
> 2007/3/2, Bert Freudenberg <bert at freudenbergs.de>:
> > On Mar 2, 2007, at 13:56 , Damien Cassou wrote:
> > > 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
> > >> >
> > Huh? Should it answer "maybe"? There is a threshold, and you chose
> > your numbers right at that threshold.
>
> I think the answer should be the same. Look at the differences:
>
> 999999 - 999899.00011. => 99.9998899999773
> 999999 - 999899.0001. => 99.9999000000535
>
> It's nearly a hundred in both cases.
>
> 999999 closeTo: 999899.00011. => true (with a difference of
> nearly 100)
> 2 closeTo: 1 => false
> (with a difference of 1)
>
> So, what is the threshold ?
0.0001? ( According to Float>>closeTo: )
frank
More information about the Squeak-dev
mailing list
|