FLINT3.7.0-dev

_ca_poly_divrem_basecase, ca_poly_divrem_basecase, _ca_poly_divrem, ca_poly_divrem, ca_poly_div, ca_poly_rem

Synopsis#include <flint/ca_poly.h>
void _ca_poly_divrem_basecase(ca_ptr Q, ca_ptr R, ca_srcptr A, slong lenA, ca_srcptr B, slong lenB, const ca_t invB, ca_ctx_t ctx)source
int ca_poly_divrem_basecase(ca_poly_t Q, ca_poly_t R, const ca_poly_t A, const ca_poly_t B, ca_ctx_t ctx)source
void _ca_poly_divrem(ca_ptr Q, ca_ptr R, ca_srcptr A, slong lenA, ca_srcptr B, slong lenB, const ca_t invB, ca_ctx_t ctx)source
int ca_poly_divrem(ca_poly_t Q, ca_poly_t R, const ca_poly_t A, const ca_poly_t B, ca_ctx_t ctx)source
int ca_poly_div(ca_poly_t Q, const ca_poly_t A, const ca_poly_t B, ca_ctx_t ctx)source
int ca_poly_rem(ca_poly_t R, const ca_poly_t A, const ca_poly_t B, ca_ctx_t ctx)source

If the leading coefficient of B is proved nonzero, sets Q and R to the quotient and remainder of the division of A by B, with \deg R < \deg B, and returns 1. Otherwise, in particular if B is zero, returns 0 and leaves the outputs unspecified.

The underscore versions take the precomputed inverse invB of the leading coefficient of B, require \mathit{lenA} \ge \mathit{lenB} \ge 1, and write \mathit{lenA} - \mathit{lenB} + 1 coefficients to Q and \mathit{lenB} - 1 to R. The algorithm is classical long division (the default versions call the basecase versions).

Cite this page

The FLINT team, “_ca_poly_divrem_basecase, ca_poly_divrem_basecase, _ca_poly_divrem, ca_poly_divrem, ca_poly_div, ca_poly_rem (ca_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/ca_poly/_ca_poly_divrem_basecase.html (generated 2026-10-20).