Welcome to %s forums

<No. 1 Community for developers, by developers/>

Login Register

Javascript Math library functions that return NaN

Get support on JavaScript,jQuery, AJAX and other related technology.
Post Reply
admin
Site Admin
Posts: 45

Javascript Math library functions that return NaN

Post by admin » Sun Oct 20, 2019 2:39 am

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

Code: Select all

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

Code: Select all

Math.sqrt(-1)

Post Reply