FLINT3.7.0-dev

n_randlimb, _n_randlimb

Synopsis#include <flint/ulong_extras.h>
ulong n_randlimb(flint_rand_t state)source
ulong _n_randlimb(flint_rand_t state)source

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