fmpz_nextprime
Synopsis
#include <flint/fmpz.h>Sets res to the smallest prime greater than n (2 for n \le 1). If proved is nonzero, the result is proved prime with fmpz_is_prime; otherwise it is a probable prime (n_nextprime for small n, GMP's mpz_nextprime, a Baillie–PSW test, otherwise).
Cite this page
The FLINT team, “fmpz_nextprime (fmpz.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpz/fmpz_nextprime.html (generated 2026-10-20).
@misc{flint-doc-fmpz-fmpz-nextprime,
author = {{The FLINT team}},
title = {{fmpz\_nextprime (fmpz.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fmpz/fmpz_nextprime.html},
note = {Generated 2026-10-20}
}