Math library functions that return NaN

suggest change

A Math function returns NaN when an argument cannot be converted to a number. Values that do convert are used. Math.floor("1") is 1, and Math.floor(null) is 0. Math.floor("a") is 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)

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents