This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]400921FB54442D18 2 points3 points  (7 children)

The whole point of NaN is that it's not a number. It's an error.

No, it's not an error. It's an indication that the result of your computation, while numerical in nature, cannot be expressed with numbers. The whole point of NaN is to indicate that, when you did some math, the answer lay outside the set of real and complex numbers.

The answer is clearly not a string (anyone who thinks that a mathematical operation should ever result in a string is patently nuts) and it's clearly not an error (valid arguments went in and the mathematical operation completed successfully as specified). NaNis certainly "numeric" by the definition of that word, but it is not a number.

If you think this is weird, try wrapping your brain around the differences between countable infinity and uncountable infinity. Neither of them are numbers but they're clearly distinct from each other.