Re:Learning Elm has gotten me confused about static vs. dyna...
by kazinator on Tuesday June 14, 2016 @10:15PM
(#11906802)
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!
You certainly don't need to write tests that Math.floor will return NaN when you pass it something that's not a number...