3 ms·
What? NaN is actually a number in the sense of being in the domain of the floating-point type. You seem to be mixing up "not a number" (as in character string o
by kazinator 10y ago
What? NaN is actually a number in the sense of being in the domain of the floating-point type. You seem to be mixing up "not a number" (as in character string or list) versus "not a number" as in a special IEEE representation that has special uses in numeric code.
A floor function that returns NaN when given a string, instead of throwing a type mismatch exception, is crap design, and a strawman example of that type of checking. It's not an appropriate use of NaN!
- jdmichal 10y agoI agree with you [0], but that's what JavaScript gives us to work with. [0] https://news.ycombinator.com/item?id=11898046 https://news.ycombinator.com/item?id=11898046