mpn_mod_mul, mpn_mod_sqr
Synopsis
#include <flint/mpn_mod.h>The product (x 2^{\nu}) y of 2\ell limbs is reduced modulo n 2^{\nu} with the precomputed inverse of the context (a quotient estimate from one high product and one low product, followed by at most a few subtractions) and shifted back; see Modular multiplication with a multiword modulus. Two-limb moduli use the inline code of flint_mpn_mulmod_preinvn_2. When x and y are the same pointer, the product is computed by squaring. This is the algorithm of flint_mpn_mulmod_preinvn, with the shift applied to an input instead of the output.
Guides#
Cite this page
The FLINT team, “mpn_mod_mul, mpn_mod_sqr (mpn_mod.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mpn_mod/mpn_mod_mul.html (generated 2026-10-20).
@misc{flint-doc-mpn-mod-mpn-mod-mul,
author = {{The FLINT team}},
title = {{mpn\_mod\_mul, mpn\_mod\_sqr (mpn\_mod.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/mpn_mod/mpn_mod_mul.html},
note = {Generated 2026-10-20}
}