by dap · 14y ago · 0 comments
Also, isNaN is global.
You should be harsher on him. NaN is definitely a number in practically every programming language.
(type-of (/ 0.0 0.0))
SINGLE-FLOAT
System.err.println((new Double(0.0/0.0)) instanceof Number)
true
from types import *
type(1e10000 / 1e10000)
<type 'float'>
It looks like the blogger is just out and out mistaken. But there's more. The poster goes on about NaN not being easy to check for: not realizing that it's the only value which is never equal to itself. He even thinks this is a bug.In this context, 'NaN' just happens to be another admissible value within the space of "number".