News for hackers. Stuff that matters.
Re:NaN does not equal NaN by teaspoon on Tuesday September 27, 2011 @04:51PM (#3045178)
blah is now NaN because (5 + NaN) is NaN. We want this because we want to know if there's been some kind of error in the making of blah

Commence countdown to frontpage submission "Float is a monad". I agree with your justification for 5 + NaN evaluating to NaN, but it would be even more useful if NaN == x (and every other operation on NaN) would evaluate to NaN as well. That's obviously not possible in statically typed languages, but it is in JS.

Re:NaN does not equal NaN by sid0 on Tuesday September 27, 2011 @05:51PM (#3045404)
Haha, "float is a monad" is the first thing that popped into my head when I read that.