FLINT3.7.0-dev

fmpz_mod_ctx_set_modulus, fmpz_mod_ctx_set_modulus_ui

Synopsis#include <flint/fmpz_mod.h>
void fmpz_mod_ctx_set_modulus(fmpz_mod_ctx_t ctx, const fmpz_t n)source
void fmpz_mod_ctx_set_modulus_ui(fmpz_mod_ctx_t ctx, ulong n)source

Changes the modulus of the initialised context ctx to n, which must be positive. Residues computed for the old modulus are not reduced.

Cite this page

The FLINT team, “fmpz_mod_ctx_set_modulus, fmpz_mod_ctx_set_modulus_ui (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_set_modulus.html (generated 2026-10-20).