n_randprime
Synopsis
#include <flint/ulong_extras.h>ulong n_randprime(flint_rand_t state, ulong bits, int proved)sourceReturns 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).
@misc{flint-doc-ulong-extras-n-randprime,
author = {{The FLINT team}},
title = {{n\_randprime (ulong\_extras.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/ulong_extras/n_randprime.html},
note = {Generated 2026-10-20}
}