|
|
|
|
|
by personjerry
4367 days ago
|
|
tl;dr: Guy suggests isNumber(NaN) should be false. But it's true because NaN is part of floating points as defined by IEEE. 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. |
|
Or, better, call the JavaScript type that represents IEEE-754 Binary64 format -- which includes the union of three sets (finite numbers in a given range, two infinite numbers, and two kinds of Not-a-Number values) something other than "Number".