FLINT3.7.0-dev

flint_mpn_rrandom, flint_mpn_rrandomb

Synopsis#include <flint/mpn_extras.h>
void flint_mpn_rrandom(mp_ptr rp, flint_rand_t state, mp_size_t n)source
void flint_mpn_rrandomb(mp_ptr rp, flint_rand_t state, flint_bitcnt_t n)source

Set (\mathit{rp}, n), respectively (\mathit{rp}, \lceil n/\mathtt{FLINT\_BITS} \rceil) with an n-bit value, to a random integer with long runs of zeros and ones in its binary representation. Such numbers trigger corner cases (carry propagation, near-overflow) more often than uniform ones and are used in tests.

Cite this page

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