FLINT3.7.0-dev

fmpz_nextprime

Synopsis#include <flint/fmpz.h>
void fmpz_nextprime(fmpz_t res, const fmpz_t n, int proved)source

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).