FLINT3.7.0-dev

_mpn_mod_poly_divrem, _mpn_mod_poly_div

Synopsis#include <flint/mpn_mod.h>
int _mpn_mod_poly_divrem(nn_ptr Q, nn_ptr R, nn_srcptr A, slong lenA, nn_srcptr B, slong lenB, gr_ctx_t ctx)source
int _mpn_mod_poly_div(nn_ptr Q, nn_srcptr A, slong lenA, nn_srcptr B, slong lenB, gr_ctx_t ctx)source

Division with remainder A = QB + R and the quotient alone, with the conventions of _gr_poly_divrem (\mathit{lenA} \ge \mathit{lenB} \ge 1, Q with room for \mathit{lenA} - \mathit{lenB} + 1 and R for \mathit{lenB} - 1 coefficients, leading coefficient of B invertible). _mpn_mod_poly_divrem uses the delayed-reduction basecase when \mathit{lenA}, \mathit{lenB} or \mathit{lenA} - \mathit{lenB} is at most a cutoff (between 38 and 166 depending on the size of n), and Newton division otherwise; _mpn_mod_poly_div uses _gr_poly_div_basecase up to the series division cutoff and _gr_poly_div_newton above it. Return GR_DOMAIN (or GR_UNABLE when pretending) if the leading coefficient of B is not invertible.

Cite this page

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