|
|
|
|
|
by dragonwriter
4367 days ago
|
|
> This may be correct, but why name it NaN if its a number. It is definitively not a number in the usual, mathematical sense -- hence the name, which comes from IEEE 754. However, the isNumber function doesn't really check if things are numbers, it checks if they are of the Number type, which, potentially confusingly, includes things which are not numbers, including the accurately named value Not-a-Number (NaN). |
|
That would imply then that isNumber is named incorrectly. So perhaps isNumber should read isNumericType?
Most of the time I want to test, is this a number I can use in a normal mathematical sense. As in, can I use it in subtraction, multiplication etc. I know now that I should use isFinite and isNumber, but wouldn't it be nice to have just one well named function for this?