From http://www.w3schools.com (Copyright Refsnes Data)
JavaScript Math Object
The sqrt() method returns the square root of a number.
| Math.sqrt(x) |
| Parameter | Description |
|---|---|
| x | Required. A number |
Note: The sqrt() method will return NaN if the parameter x is a negative number.
ExampleReturn the square root of different numbers:
The output of the code above will be:
Try it yourself » |
JavaScript Math Object
From http://www.w3schools.com (Copyright Refsnes Data)