mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
1.4 KiB
1.4 KiB
| layout |
|---|
| default |
Function sqrt #
Calculate the square root of a value.
For matrices, the function is evaluated element wise.
Syntax #
math.sqrt(x)
Parameters #
| Parameter | Type | Description |
|---|---|---|
x |
number | BigNumber | Complex | Array | Matrix | Unit | Value for which to calculate the square root. |
Returns #
| Type | Description |
|---|---|
| number | BigNumber | Complex | Array | Matrix | Unit | Returns the square root of x |
Throws #
| Type | Description |
|---|
Examples #
math.sqrt(25) // returns 5
math.square(5) // returns 25
math.sqrt(-4) // returns Complex 2i