FLINT3.7.0-dev

NMOD_RED

Synopsis#include <flint/nmod.h>
NMOD_RED(r, a, mod)source

Sets r to a mod na \bmod n for any word aa and any nn. It uses one high and one low product (none if nn has FLINT_BITS bits), with a constant derived from mod.ninv (Barrett reduction with an nmod_t), and is cheaper than reducing aa as a two-word number with NMOD_RED2.

Cite this page

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