FLINT3.7.0-dev

gr_ctx_set_is_field

Synopsis#include <flint/gr.h>
int gr_ctx_set_is_field(gr_ctx_t ctx, truth_t is_field)source

Declares whether the ring is a field. For \mathbb{Z}/n\mathbb{Z} this declares whether n is prime: gr_ctx_init_nmod tests primality when asked, while the contexts with large moduli (gr_ctx_init_fmpz_mod, gr_ctx_init_mpn_mod) report T_UNKNOWN until the user declares it, which enables algorithms for fields. For gr_ctx_init_gr_poly_quotient it declares that the modulus is irreducible. The declaration is not checked. Returns GR_UNABLE for rings that do not support it.

Guides#

Cite this page

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