Documentation moved.
This entry is documented with its primary interface. Open the documentation →
Function
src/index.ts:912nerdamer.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
core!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"