flint_mpn_divrem_1_preinv
Synopsis
#include <flint/mpn_extras.h>mp_limb_t flint_mpn_divrem_1_preinv(mp_ptr qp, mp_srcptr up, mp_size_t n, mp_limb_t d, mp_limb_t dinv, unsigned int norm)sourceDivides (\mathit{up}, n) by the limb d, writing the quotient to (\mathit{qp}, n) and returning the remainder. Requires n \ge 1, d \ne 0, norm the number of leading zero bits of d and dinv = n_preinvert_limb(d). qp may alias up. This is equivalent to mpn_divrem_1(qp, 0, up, n, d) and faster for small n; for large n GMP's assembly is usually faster.
Cite this page
The FLINT team, “flint_mpn_divrem_1_preinv (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_1_preinv.html (generated 2026-10-20).
@misc{flint-doc-mpn-extras-flint-mpn-divrem-1-preinv,
author = {{The FLINT team}},
title = {{flint\_mpn\_divrem\_1\_preinv (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_divrem_1_preinv.html},
note = {Generated 2026-10-20}
}