<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Sep 3, 2014 at 4:11 PM, Chris Muller <span dir="ltr">&lt;<a href="mailto:ma.chris.m@gmail.com" target="_blank">ma.chris.m@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">When could it happen?<br>
<br>
A:  With Float nan.<br>
<br>
   Float nan == Float nan   &quot;true&quot;<br>
<br>
   Float nan = Float nan   &quot;false&quot;<br>
<br>
It violates what I have long considered an invariant that if a==b, then a=b.<br>
<br>
Real world context:  When two DB clients change the same object in the<br>
exact same way, it&#39;s not a conflict.  If they change it differently,<br>
it is.<br>
<br>
They&#39;ve both made the same reference to Float nan, but just asking if<br>
they made equivalent changes still reports false.  So I have to put in<br>
a complicated special check for NaN first..??<br>
<br>
Okay, I actually wrote:  (a==b or: [a=b]) but who would ever write<br>
that or not &quot;simplify it&quot; in teh future if they saw it?<br>
<br>
Comments?  Why shouldn&#39;t Float nan = Float nan?<br></blockquote><div><br></div><div>Because non-a-numbers result from overflowing or underflowing computations, and hence, just because two computations produce the same not-a-number doesn&#39;t imply that the two computations are equivalent.  This is why the <span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px">IEEE-754 standard requires that NaN != NaN.</span></div>
</div>-- <br>best,<div>Eliot</div>
</div></div>