# cupy.roots¶

cupy.roots(p)[source]

Computes the roots of a polynomial with given coefficients.

Parameters

p (cupy.ndarray or cupy.poly1d) – polynomial coefficients.

Returns

polynomial roots.

Return type

cupy.ndarray

Warning

This function doesn’t support currently polynomial coefficients whose companion matrices are general 2d square arrays. Only those with complex Hermitian or real symmetric 2d arrays are allowed.

The current cupy.roots doesn’t guarantee the order of results.