Bill Frantz: Re: ELib: ELang: Equality totally screwed up. Needs overhaul

Jonathan S. Shapiro shap@eros.cis.upenn.edu
Fri, 18 Sep 1998 10:43:55 -0400


[I am forwarding this to the e-lang list so that it will get
 archived.  Sorry about the duplication.

 Please send notes to e-lang@eros.cis.upenn.edu.]

------- Forwarded Message

At 10:17 PM 9/17/98 -0700, Mark S. Miller wrote:
>At 05:20 PM 9/17/98 -0700, Bill Frantz wrote:
>>At 05:05 PM 9/17/98 -0400, shap@eros.cis.upenn.edu wrote:
>>>I hesitate only because as a non-Java-person I'm not sure what the
>>>semantics of Java's eq operator are.
>>>
>>>> What does the IEEE standard say?  Java's "!=" does indeed disagree with
>>>> your "Different()".  Rather, in java, "a != b" is always equivalent to
>"!(a
>>>> == b)".  If Java & IEEE agree, I'll be strongly inclined to follow along.
>>
>>Java is particularly brain dead with NaNs.  If you have two Floats which
>>are NaN, then:  a == b yields true.  
>
>To be precise, 'a.equals(b)' yields true, and 'a == b' yields true iff 'a'
>and 'b' point to the identical Float object.
>
>
>>If you have two floats (note the caps)
>>which are NaN, then correctly: a == b yields false and a != b yields false.
>
>In this case, I believe 'a != b' yield true.

Yup.  I should RTFM first.



------- End of Forwarded Message