fmpq_randbits, _fmpq_randbits
Synopsis
#include <flint/fmpq.h>void fmpq_randbits(fmpq_t res, flint_rand_t state, flint_bitcnt_t bits)sourcevoid _fmpq_randbits(fmpz_t num, fmpz_t den, flint_rand_t state, flint_bitcnt_t bits)sourceChoose a numerator and a nonzero denominator of exactly bits bits each and canonicalise, so the components of the result can have fewer bits. num and den must not be aliased.
Cite this page
The FLINT team, “fmpq_randbits, _fmpq_randbits (fmpq.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpq/fmpq_randbits.html (generated 2026-10-20).
@misc{flint-doc-fmpq-fmpq-randbits,
author = {{The FLINT team}},
title = {{fmpq\_randbits, \_fmpq\_randbits (fmpq.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fmpq/fmpq_randbits.html},
note = {Generated 2026-10-20}
}