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 xR−1 mod nx R^{-1} \bmod n for any word xx. n_redc_fast returns a value in [0,n][0, n], which may need one more subtraction of nn.

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-11-02).