simple-squiggle

A restricted subset of Squiggle
Log | Files | Refs | README

sqrt.md (974B)


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