FLINT3.7.0-dev

ca_randtest

Synopsis#include <flint/ca.h>
void ca_randtest(ca_t res, flint_rand_t state, slong depth, slong bits, ca_ctx_t ctx)source

Sets res to a random number obtained by evaluating a random expression. At depth 0 it is a random rational number, an element of a quadratic field with coefficients of up to bits bits, or a constant such as \pi; for positive depth it may instead be an arithmetic operation or a function applied to operands generated recursively with depth depth - 1. The result is always a number, not a special value.

Cite this page

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