Function isNaN

Test whether a value is NaN (not a number). The function supports types number, BigNumber, Fraction, Unit and Complex.

The function is evaluated element-wise in case of Array or Matrix input.




Parameter Type Description
x number | BigNumber | Fraction | Unit | Array | Matrix Value to be tested


Type Description
boolean Returns true when x is NaN. Throws an error in case of an unknown data type.


isNaN(3);                     // returns false
isNaN(NaN);                   // returns true
isNaN(0);                     // returns false
isNaN(bignumber(NaN));   // returns true
isNaN(bignumber(0));     // returns false
isNaN(fraction(-2, 5));  // returns false
isNaN('-2');                  // returns false
isNaN([2, 0, -3, NaN]');      // returns [false, false, false, true]

See also

isNumeric, isNegative, isPositive, isZero, isInteger