n_randint, n_urandint, _n_randint
Synopsis
#include <flint/ulong_extras.h>ulong n_randint(flint_rand_t state, ulong limit)sourceulong n_urandint(flint_rand_t state, ulong limit)sourceulong _n_randint(flint_rand_t state, ulong limit)sourceReturns a uniformly random integer in [0, \mathit{limit}), or a random limb if limit is 0. The three functions are equivalent; _n_randint is inline.
Cite this page
The FLINT team, “n_randint, n_urandint, _n_randint (ulong_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/ulong_extras/n_randint.html (generated 2026-10-20).
@misc{flint-doc-ulong-extras-n-randint,
author = {{The FLINT team}},
title = {{n\_randint, n\_urandint, \_n\_randint (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_randint.html},
note = {Generated 2026-10-20}
}