FLINT3.7.0-dev

fmpz_poly_randtest, fmpz_poly_randtest_unsigned, fmpz_poly_randtest_not_zero

Synopsis#include <flint/fmpz_poly.h>
void fmpz_poly_randtest(fmpz_poly_t f, flint_rand_t state, slong len, flint_bitcnt_t bits)source
void fmpz_poly_randtest_unsigned(fmpz_poly_t f, flint_rand_t state, slong len, flint_bitcnt_t bits)source
void fmpz_poly_randtest_not_zero(fmpz_poly_t f, flint_rand_t state, slong len, flint_bitcnt_t bits)source

Set f to a random polynomial of length at most len whose coefficients have at most bits bits, with random signs (randtest), nonnegative (randtest_unsigned), or, for randtest_not_zero, not the zero polynomial, which requires len and bits to be positive. The coefficients are generated by fmpz_randtest, which favours special values (zero, small values, values close to powers of two), so these functions are meant for testing.

Cite this page

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