FLINT3.7.0-dev

n_randprime

Synopsis#include <flint/ulong_extras.h>
ulong n_randprime(flint_rand_t state, ulong bits, int proved)source

Returns a random prime with exactly bits bits, where 2 \le \mathit{bits} \le \mathtt{FLINT\_BITS}. The result is always a proved prime; the flag proved has no effect.

Cite this page

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