fmpz_mod_ctx_struct, fmpz_mod_ctx_t
Synopsis
#include <flint/fmpz_mod.h>fmpz_mod_ctx_structfmpz_mod_ctx_tThe 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#
- Using fmpz_mod
- Prime and composite moduli (
fmpz_mod_mat) - Getting started with fmpz_mod_poly (
fmpz_mod_poly) - Getting started with finite fields (
fq_default)
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).
@misc{flint-doc-fmpz-mod-fmpz-mod-ctx-struct,
author = {{The FLINT team}},
title = {{fmpz\_mod\_ctx\_struct, fmpz\_mod\_ctx\_t (fmpz\_mod.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fmpz_mod/fmpz_mod_ctx_struct.html},
note = {Generated 2026-10-20}
}