[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
5.7.4 Polynomial division
The two functions
ex quo(const ex & a, const ex & b, const ex & x); ex rem(const ex & a, const ex & b, const ex & x); |
compute the quotient and remainder of univariate polynomials in the variable ‘x’. The results satisfy a = b*quo(a, b, x) + rem(a, b, x).
The additional function
ex prem(const ex & a, const ex & b, const ex & x); |
computes the pseudo-remainder of ‘a’ and ‘b’ which satisfies c*a = b*q + prem(a, b, x), where c = b.lcoeff(x) ^ (a.degree(x) - b.degree(x) + 1).
Exact division of multivariate polynomials is performed by the function
bool divide(const ex & a, const ex & b, ex & q); |
If ‘b’ divides ‘a’ over the rationals, this function returns true
and returns the quotient in the variable q
. Otherwise it returns false
in which case the value of q
is undefined.