I love the folks getting all snarky and superior at the guy who was foolish enough to suggest that "Not a Number" should not be a number.<p>There's probably some cutting insight into programmer culture here somewhere.
This may be correct, but why name it NaN if its a number. I thought we were meant to write readable code. Poor naming like this in the specs really does not help.
This discussion is ridiculous. NaN should obviously return true of isNumber, and probably just indicates you did something funky with your numbers and they exploded. They're still numbers, you're the one who's at fault (I never really saw NaN come by on purpose...). It's just that computers can't really represent some numbers and when that happens you get NaN and as much as you want languages to read as english or be perfect abstractions sometimes practical implementations details end up surfacing and theres nothing you can do.
tl;dr: Guy suggests isNumber(NaN) should be false. But it's true because NaN is part of floating points as defined by IEEE.<p>My own interpretation? While programmers shouldn't care so much about this particular kind of semantics (instead they should understand the theory behind floats and never have to run into this issue) it might be better just to call NaNs something else, like "undefined number" or something.