FLINT3.7.0-dev

flint_mpn_divrem_preinv1

Synopsis#include <flint/mpn_extras.h>
mp_limb_t flint_mpn_divrem_preinv1(mp_ptr q, mp_ptr a, mp_size_t m, mp_srcptr b, mp_size_t n, mp_limb_t dinv)source

Divides (a, m) by the normalised (b, n), returning the top limb of the quotient (0 or 1), writing the remaining m - n quotient limbs to q and the remainder in place to (a, n). Requires m \ge n \ge 2 and dinv = flint_mpn_preinv1(b[n - 1], b[n - 2]). This is _flint_mpn_divrem_preinv1 (schoolbook or divide and conquer division) with scratch space allocated as needed.

Cite this page

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