FLINT3.7.0-dev

n_randbits

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

Returns a uniformly random integer with exactly bits bits (the top bit is set), or 0 if bits is 0.

Cite this page

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