mathjs
Version:
Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with dif
53 lines (37 loc) • 1.02 kB
Markdown
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
Calculate the nth roots of a value.
An nth root of a positive real number A,
is a positive real solution of the equation "x^root = A".
This function returns an array of complex values.
```js
math.nthRoots(x)
math.nthRoots(x, root)
```
Parameter | Type | Description
--------- | ---- | -----------
`x` | number &
Type | Description
---- | -----------
number &
```js
math.nthRoots(1)
// returns [
// {re: 1, im: 0},
// {re: -1, im: 0}
// ]
nthRoots(1, 3)
// returns [
// { re: 1, im: 0 },
// { re: -0.4999999999999998, im: 0.8660254037844387 },
// { re: -0.5000000000000004, im: -0.8660254037844385 }
]
```
[ ](nthRoot.md),
[ ](pow.md),
[ ](sqrt.md)