UNPKG

922 BMarkdownView Raw
1<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
2
3# Function sqrt
4
5Calculate the square root of a value.
6
7For matrices, the function is evaluated element wise.
8
9
10## Syntax
11
12```js
13math.sqrt(x)
14```
15
16### Parameters
17
18Parameter | Type | Description
19--------- | ---- | -----------
20`x` | number &#124; BigNumber &#124; Complex &#124; Array &#124; Matrix &#124; Unit | Value for which to calculate the square root.
21
22### Returns
23
24Type | Description
25---- | -----------
26number &#124; BigNumber &#124; Complex &#124; Array &#124; Matrix &#124; Unit | Returns the square root of `x`
27
28
29## Examples
30
31```js
32math.sqrt(25) // returns 5
33math.square(5) // returns 25
34math.sqrt(-4) // returns Complex 2i
35```
36
37
38## See also
39
40[square](square.md),
41[multiply](multiply.md),
42[cube](cube.md),
43[cbrt](cbrt.md),
44[sqrtm](sqrtm.md)