FLINT3.7.0-dev

MPN_MOD_MIN_LIMBS, MPN_MOD_MAX_LIMBS

Synopsis#include <flint/mpn_mod.h>
MPN_MOD_MIN_LIMBSsource
MPN_MOD_MAX_LIMBSsource

The permitted numbers of limbs of the modulus: currently \ell \ge 2 and \ell \le 16, that is moduli up to 1024 bits on 64-bit machines and up to 512 bits on 32-bit machines.

Single-limb moduli are excluded because nmod already handles them well, and excluding them removes special cases from the code. The upper limit keeps elements and temporary buffers (a small multiple of \ell limbs) small enough to allocate on the stack and keeps operations such as swaps cheap compared with a pointer to heap memory; the tuning tables also only cover this range. For larger moduli, use fmpz_mod (or gr_ctx_init_fmpz_mod). The upper limit might be increased in the future.

Guides#

Cite this page

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