Float equality again (was Re: Fraction equality and Float infinity
ncellier at ifrance.com
Fri May 12 23:32:14 UTC 2006
Le Mercredi 29 Mars 2006 10:22, nicolas cellier a écrit :
> I am not totally opposed to more radical solution you seem suggesting: (2 =
> 2.0) never answer true.
> In this case, we can still have efficient hash for comparing (2.0=2.0), and
> do not have to bother with Integer and Fraction.
I must answer no to myself because nobody did:
As we won't have neither (2>2.0) nor (2<2.0), if we do not have (2=2.0),
then that means that Numbers are unordered...
Something i dislike and would not vote for.
True, 2.0 might be inexact, maybe it is 1.9999, maybe 2.0001,
but if i want such behaviour, i would rather use interval arithmetic
Such intervals cannot be fully ordered.
More information about the Squeak-dev