News for hackers. Stuff that matters.
Re:NaN does not equal NaN by brendoncrawford on Tuesday September 27, 2011 @04:56PM (#3045195)
This is correct behaviour. You are supposed to use `isNaN()`, which makes perfect sense.

This is the same as SQL where `NULL IS NULL` is true, but `NULL = NULL` is not true.

Re:NaN does not equal NaN by blahedo on Tuesday September 27, 2011 @06:54PM (#3045609)
Even better: since SQL has a tri-valued logic (T, F, Unknown) it can assign "Unknown" as the result of a test against NULL. That means that `3 = NULL` is not true, but `3 != NULL` is also not true. If testing against NULL were merely false, then you'd have the bizarre result that

  val > 3
and

  not (val <= 3)
might return different results!

(I was just teaching this today in my DB class! Fun.)