mpn_mod_ctx_is_field, mpn_mod_ctx_set_is_field
#include <flint/mpn_mod.h>Return or set the primality flag of the modulus. mpn_mod_ctx_set_is_field always returns GR_SUCCESS; nothing is checked. These are the gr_ctx_is_field and gr_ctx_set_is_field methods (the flag also answers gr_ctx_is_integral_domain and gr_ctx_is_unique_factorization_domain).
Setting the flag to T_TRUE for a prime modulus lets the generic algorithms for fields (polynomial factorisation and root finding, square roots, and so on) run instead of returning GR_UNABLE. Setting it for a composite modulus gives undefined results.
The FLINT team, “mpn_mod_ctx_is_field, mpn_mod_ctx_set_is_field (mpn_mod.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mpn_mod/mpn_mod_ctx_is_field.html (generated 2026-10-20).
@misc{flint-doc-mpn-mod-mpn-mod-ctx-is-field,
author = {{The FLINT team}},
title = {{mpn\_mod\_ctx\_is\_field, mpn\_mod\_ctx\_set\_is\_field (mpn\_mod.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/mpn_mod/mpn_mod_ctx_is_field.html},
note = {Generated 2026-10-20}
}