Documentation moved.
This entry is now part of the unified function reference. Open the unified page →
Function
src/index.ts:774nerdamer.sqrt
nerdamer.sqrt(x: ExpressionInput): ExpressionComputes the square root of an expression. Equivalent to raising to the power of 1/2. Nested square roots are automatically simplified (e.g.
`sqrt(sqrt(x))`becomes
`x^(1/4)`).
throws
UndefinedError If
`x`is
`-∞`.
Parameters
| Name | Type | Description |
|---|---|---|
x | ExpressionInput | The expression to take the square root of. |
Returns
Expression — The square root of `x`.
Examples
// Numeric
sqrt(4).text() // "2"
sqrt('1/4').text() // "1/2"
// Symbolic
sqrt('x^2').text() // "x"
sqrt('x').text() // "sqrt(x)"
sqrt(0).text() // "0"