JavaScript Math library functions that return NaN


Example

Generally, Math functions that are given non-numeric arguments will return NaN.

Math.floor("a")

The square root of a negative number returns NaN, because Math.sqrt does not support imaginary or complex numbers.

Math.sqrt(-1)