Navigation

Operators and Keywords

Function List:

C++ API

: nthroot (x, n)

Compute the real (non-complex) n-th root of x.

x must have all real entries and n must be a scalar. If n is an even integer and x has negative entries then nthroot aborts and issues an error.

Example:

nthroot (-1, 3)
⇒ -1
(-1) ^ (1 / 3)
⇒ 0.50000 - 0.86603i

See also: realsqrt, sqrt, cbrt.

Package: octave