FLINT3.7.0-dev

_fmpq_poly_divrem

Synopsis#include <flint/fmpq_poly.h>
void _fmpq_poly_divrem(fmpz * Q, fmpz_t q, fmpz * R, fmpz_t r, const fmpz * A, const fmpz_t a, slong lenA, const fmpz * B, const fmpz_t b, slong lenB, const fmpz_preinvn_t inv)source

Finds the quotient (Q, q) and remainder (R, r) of the Euclidean division of (A, a) by (B, b).

Assumes that lenA >= lenB > 0. Assumes that R has space for lenA coefficients, although only the bottom lenB - 1 will carry meaningful data on exit. Supports no aliasing between the two outputs, or between the inputs and the outputs.

An optional precomputed inverse of the leading coefficient of B from fmpz_preinvn_init can be supplied. Otherwise inv should be NULL.

Note: fmpz.h has to be included before fmpq_poly.h in order for the latter to declare this function.

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).