polroots

Returns the roots of a polynomial.

Polynomials can be created using the special constant X and operators. For example, to create $x^2+5x+6$, type X**2+5*X+6, which will be evaluated to [6, 5, 1].

Syntax

polroots(coefficients)

Parameters

Return value

An array of roots of the polynomial.

Examples

polroots([6, 5, 1])
[-2, -3]
polroots(X**2 + 5*X + 6)
[-2, -3]