mpn_mod_set_mpn
Synopsis
#include <flint/mpn_mod.h>Sets res to , where is given by the xn limbs at x (; the top limb may be zero). This is the reduction used throughout the module for unreduced sums and products. res may be the same pointer as x but must not overlap it otherwise.
Values with fewer limbs than , or with limbs and less than , are copied. Otherwise is shifted left by bits and divided by , with GMP's mpn_divrem_2 for and with flint_mpn_mod_preinvn and the precomputed inverse of the context for .
Cite this page
The FLINT team, “mpn_mod_set_mpn (mpn_mod.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mpn_mod/mpn_mod_set_mpn.html (generated 2026-11-02).
@misc{flint-doc-mpn-mod-mpn-mod-set-mpn,
author = {{The FLINT team}},
title = {{mpn\_mod\_set\_mpn (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_set_mpn.html},
note = {Generated 2026-11-02}
}