numpy.polydiv

numpy.polydiv(u, v)

Returns the quotient and remainder of polynomial division.

The input arrays specify the polynomial terms in turn with a length equal to the polynomial degree plus 1.

Parameters:

u : {array_like, poly1d}

Dividend polynomial.

v : {array_like, poly1d}

Divisor polynomial.

Returns:

q : ndarray

Polynomial terms of quotient.

r : ndarray

Remainder of polynomial division.

Examples

\frac{3x^2 + 5x + 2}{2x + 1} = 1.5x + 1.75, remainder 0.25

>>> x = np.array([3.0, 5.0, 2.0])
>>> y = np.array([2.0, 1.0])
>>> np.polydiv(x, y)
>>> (array([ 1.5 ,  1.75]), array([ 0.25]))

Previous topic

numpy.polyadd

Next topic

numpy.polymul

This Page

Quick search