FLINT3.7.0-dev

n_ll_redc, n_ll_redc_fast

Synopsis#include <flint/nmod.h>
ulong n_ll_redc(ull_t x, ulong n, ulong nred)source
ulong n_ll_redc_fast(ull_t x, ulong n, ulong nred)source

Return a value congruent to xR−1x R^{-1} modulo nn, for a two-word xx. n_ll_redc requires x<nBx < nB and returns a value in [0,n)[0, n). n_ll_redc_fast requires x+(B−1)n<B2x + (B - 1) n < B^2 and returns a value below x/B+nx/B + n.

Cite this page

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