FLINT3.7.0-dev

fmpq_poly_divrem

Synopsis#include <flint/fmpq_poly.h>
void fmpq_poly_divrem(fmpq_poly_t Q, fmpq_poly_t R, const fmpq_poly_t poly1, const fmpq_poly_t poly2)source

Finds the quotient Q and remainder R of the Euclidean division of poly1 by poly2, so that \mathit{poly1} = Q \cdot \mathit{poly2} + R with \deg R < \deg \mathit{poly2}. Q and R must be distinct objects (an exception is raised otherwise), and a zero poly2 raises FLINT_DIVZERO.

The division is done over \mathbb{Z} by pseudo-division (_fmpz_poly_pseudo_divrem, see division and pseudo-division), \mathrm{lc}(B)^k A = QB + R, after which the denominators are adjusted; this avoids rational arithmetic in the inner loop.

Cite this page

The FLINT team, “fmpq_poly_divrem (fmpq_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpq_poly/fmpq_poly_divrem.html (generated 2026-10-20).