flint_mpn_divexact
#include <flint/mpn_extras.h>void flint_mpn_divexact(mp_ptr q, mp_srcptr a, mp_size_t an, mp_srcptr b, mp_size_t bn)sourceExact division: sets to , assuming that divides (otherwise the result is meaningless).
Single-limb divisors are handled by mpn_divexact_1. Otherwise the division is done 2-adically: writing with odd, the quotient is , where is the number of quotient limbs (, or one less when the top limb of is below that of ). With significant divisor limbs, uses register-resident code specialised for each , with the shift done on the fly and the limb inverse computed inline. Larger use ports of GMP's schoolbook and divide and conquer Hensel division (mpn_sbpi1_bdiv_q, and mpn_dcpi1_bdiv_q from FLINT_MPN_DC_BDIV_Q_CUTOFF limbs) with FLINT's multiplication, and the Newton iteration flint_mpn_bdiv_q from FLINT_MPN_DIVEXACT_NEWTON_CUTOFF, or already from FLINT_MPN_DIVEXACT_UNBALANCED_CUTOFF when .
The FLINT team, “flint_mpn_divexact (mpn_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mpn_extras/flint_mpn_divexact.html (generated 2026-11-02).
@misc{flint-doc-mpn-extras-flint-mpn-divexact,
author = {{The FLINT team}},
title = {{flint\_mpn\_divexact (mpn\_extras.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/mpn_extras/flint_mpn_divexact.html},
note = {Generated 2026-11-02}
}