Shouldn't 2 hash = 2.0 hash? [LONG]

David N. Smith (IBM) dnsmith at watson.ibm.com
Thu Dec 2 00:21:54 UTC 1999


At 18:28 -0500 12/1/99, David N. Smith \(IBM\) wrote:
>...SNIP...
>Also note that if not, one could have the case where:
>
>    1.0 = 1.0  =>  false
>
>but
>
>    1.0 == 1.0 =>  true!

There is another case that follows.

If, for equal a and b, if a=b is false, a>=b would *also have* to 
answer false, else we could write an equality test this way:

   (a<b
       ifFalse: [a>=b & (a>b) not]
       ifTrue:  [a<=b & (a<b) not])

But, if a=b answers false, and a>=b answers false, and obviously a<b 
and a<=b are false, how do the values compare? In IEEE there is one 
other option, called unordered, but that happens only when one or 
both values are NaNs, and both a and b would fail the test for NaNs.

So, making a=b answer false leads to a logical impossibility where 
all possible relationships are false.

Dave  :-)
_______________________________
David N. Smith
IBM T J Watson Research Center
Hawthorne, NY
_______________________________
Any opinions or recommendations
herein are those of the author
and not of his employer.





More information about the Squeak-dev mailing list