FLINT3.7.0-dev

flint_mpn_mod_preinvn

Synopsis#include <flint/mpn_extras.h>
void flint_mpn_mod_preinvn(mp_ptr r, mp_srcptr a, mp_size_t m, mp_srcptr d, mp_size_t n, mp_srcptr dinv)source

Sets (r,n)(r, n) to a mod da \bmod d, where (a,m)(a, m) has m≥nm \ge n limbs and the normalised (d,n)(d, n) has the inverse dinv from flint_mpn_preinvn. No aliasing of rr with aa is permitted. This is not always as fast as ordinary division.

Cite this page

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