FLINT3.7.0-dev

fmpz_randtest_mod, fmpz_randtest_mod_signed

Synopsis#include <flint/fmpz.h>
void fmpz_randtest_mod(fmpz_t f, flint_rand_t state, const fmpz_t m)source
void fmpz_randtest_mod_signed(fmpz_t f, flint_rand_t state, const fmpz_t m)source

Set f to a random integer in [0, m), respectively (-m/2, m/2], for m > 0, with an increased probability of values near the ends of the range (and near zero for the signed version).

Cite this page

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