n_randlimb, _n_randlimb
Synopsis
#include <flint/ulong_extras.h>ulong n_randlimb(flint_rand_t state)sourceulong _n_randlimb(flint_rand_t state)sourceReturns a uniformly random limb. _n_randlimb is an inline version for tight loops.
_n_randlimb advances two linear congruential generators v \leftarrow (a v + c) \bmod B with fixed constants a, c, whose states are stored in state. The high half of the first state gives the low half of the result and the high half of the second state gives its high half.
Cite this page
The FLINT team, “n_randlimb, _n_randlimb (ulong_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/ulong_extras/n_randlimb.html (generated 2026-10-20).
@misc{flint-doc-ulong-extras-n-randlimb,
author = {{The FLINT team}},
title = {{n\_randlimb, \_n\_randlimb (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_randlimb.html},
note = {Generated 2026-10-20}
}