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 ab R^{-1} modulo n. n_mulmod_redc requires ab < nB (for example a, b < n) and returns a value in [0, n). n_mulmod_redc_fast maps a, b \in [0, 2n) to [0, 2n) when n < 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-10-20).