FLINT3.7.0-dev

fmpz_randtest_unsigned, fmpz_randtest

Synopsis#include <flint/fmpz.h>
void fmpz_randtest_unsigned(fmpz_t f, flint_rand_t state, flint_bitcnt_t bits)source
void fmpz_randtest(fmpz_t f, flint_rand_t state, flint_bitcnt_t bits)source

Set f to a random integer whose absolute value has a random number of bits between 0 and bits, nonnegative for the unsigned version. The values are biased towards sparse binary representations, 0, 1 and COEFF_MAX, which exercise special cases in tests.

Cite this page

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