News for hackers. Stuff that matters.
Re:The Birth and Death of JavaScript (2014) by SonOfLilit on Sunday June 14, 2026 @12:44PM (#48529409)
Why dynamic? `NAN != NAN` is just as true in C.
Re:The Birth and Death of JavaScript (2014) by bryanrasmussen on Sunday June 14, 2026 @03:25PM (#48531586)
well as I understood it, it was implemented for languages without static data typing although I suppose you could implement it in other languages.

Also I suppose my memory could be pretty foggy as I don't think I've looked at the spec since about 2014.

Re:The Birth and Death of JavaScript (2014) by SonOfLilit on Wednesday June 17, 2026 @05:53AM (#48568053)
To my understanding, NaN is a range of particular values (all exponent bits set to 1, mantissa nonzero) of the IEEE 754 float datatype, and its semantics are defined in the standard, including the "not equal to itself" semantic. If your language uses IEEE 754 floats and it has div or sqrt operations that don't raise exceptions on out of range inputs (which is something scientific computing people want very much, so it probably has them), then it must ensure nan != nan.