FLINT3.7.0-dev

n_redc, n_redc_fast

Synopsis#include <flint/nmod.h>
ulong n_redc(ulong x, ulong n, ulong nred)source
ulong n_redc_fast(ulong x, ulong n, ulong nred)source

Return x R^{-1} \bmod n for any word x. n_redc_fast returns a value in [0, n], which may need one more subtraction of n.

Guides#

Cite this page

The FLINT team, “n_redc, n_redc_fast (nmod.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nmod/n_redc.html (generated 2026-10-20).