News for hackers. Stuff that matters.
Re:NaN, the not-a-number number that isn't NaN by mbrubeck on Thursday October 30, 2025 @12:52PM (#45762161)
We're commenting on an article about IEEE 754 floating point values. Following the IEEE 754 standard, we have:

    >> isNaN(Infinity)
    false
    >> Infinity == Infinity
    true
    >> Infinity / Infinity == 1
    false

    >> isNaN(0)
    false
    >> 0 == 0
    true
    >> 0 / 0 == 1
    false
Also, you say NaN ("not a number") is "defined as a number" but Infinity is not. I would think every IEEE 754 value is either "a number" or "not a number". But apparently you believe NaN is both and Infinity is neither?

And you say 0 / 0 is "undefined" but the standard requires it to be NaN, which you say is "defined".

There are no comments on this comment yet.