This content has been marked as final. Show 3 replies
Yes, the "NAN" case is mentioned in the comments here.
For what it is worth, it returns "NO" with ColdFusion 8.
Coldfusion MX7 is actually right! NaN is numeric in the same sense that infinity is numeric. MX7 is also right in saying that NaN, just like infinity, cannot be converted to a number. In fact, it cannot even be converted to itself! One definition of NaN is:
x is NaN if and only if (x = x) is false.
However, this makes arithmetic assumptions that fail in the real world of computers. CF8 gets it right. To avoid inconsistency in coding, IsNumeric("NaN") should return False.
I agree. The sole usefulness of the function for me is to determine whether a value can be converted to a number that CF recognizes as a number, not something that in mathematical theory is a number. I had to program a workaround when I got an unexpected error, not a big deal but still annoying.