FLINT3.7.0-dev

fmpz_mod_ctx_struct, fmpz_mod_ctx_t

Synopsis#include <flint/fmpz_mod.h>
fmpz_mod_ctx_struct
fmpz_mod_ctx_t

The context for arithmetic modulo n. An fmpz_mod_ctx_t is an array of one fmpz_mod_ctx_struct, passed by reference. The fields are n (the modulus), function pointers add_fxn, sub_fxn and mul_fxn chosen by fmpz_mod_ctx_init, mod (an nmod_t for one-word moduli), n_limbs and ninv_limbs (the modulus and the three-limb Barrett inverse \lfloor 2^{4\mathtt{FLINT\_BITS}}/n \rfloor for two-limb moduli) and ninv_huge (a precomputed inverse for moduli of more than 20 limbs, or NULL). Use fmpz_mod_ctx_modulus to read n.

Guides#

Cite this page

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