FLINT3.7.0-dev

n_mulmod_redc, n_mulmod_redc_fast

Synopsis#include <flint/nmod.h>
ulong n_mulmod_redc(ulong a, ulong b, ulong n, ulong nred)source
ulong n_mulmod_redc_fast(ulong a, ulong b, ulong n, ulong nred)source

Return a value congruent to abR−1ab R^{-1} modulo nn. n_mulmod_redc requires ab<nBab < nB (for example a,b<na, b < n) and returns a value in [0,n)[0, n). n_mulmod_redc_fast maps a,b∈[0,2n)a, b \in [0, 2n) to [0,2n)[0, 2n) when n<2FLINT_BITS−2n < 2^{\mathtt{FLINT\_BITS} - 2}.

Guides#

Cite this page

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