FLINT3.7.0-dev

NMOD_RED2_BOUNDED

Synopsis#include <flint/nmod.h>
NMOD_RED2_BOUNDED(r, a_hi, a_lo, mod)source

Sets r to (ahiB+alo) mod n(a_{hi} B + a_{lo}) \bmod n. Requires ahiB+alo<2ν+FLINT_BITS−2a_{hi} B + a_{lo} < 2^{\nu + \mathtt{FLINT\_BITS} - 2}, where ν\nu is the number of bits of nn, and 3≤ν<FLINT_BITS3 \le \nu < \mathtt{FLINT\_BITS}: for instance a product of two residues if ν≤FLINT_BITS−2\nu \le \mathtt{FLINT\_BITS} - 2, or a sum of kk such products if ν+⌈log⁡2k⌉≤FLINT_BITS−2\nu + \lceil \log_2 k \rceil \le \mathtt{FLINT\_BITS} - 2. It costs one high and one low product and one correction, with the constant of NMOD_RED (Two words below a bound), and is cheaper than NMOD_RED2.

Guides#

Cite this page

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