Function reference · Polynomials

div

Divides one polynomial by another and returns the quotient and remainder.

The result is a vector [quotient, remainder]. Polynomials in several variables work too. If the inputs aren't polynomials, the result is [0, dividend].

Notation

div(dividend, divisor)

Write it in an expression: nerdamer('div(x^2-1,x-1)'), or in the Playground.

nerdamer.div

nerdamer.div(dividend: ExpressionInput, divisor: ExpressionInput): Vector

A method on the default import. Arguments can be strings, as in Notation.

Examples

No remainder.

div(x^2-1,x-1)
// → [1+x, 0]
Open in Playground

Not polynomial division in x: [0, x].

div(x,y)
// → [0, x]
Open in Playground

← Back to Function reference