FLINT3.7.0-dev

d_randtest_signed

Synopsis#include <flint/double_extras.h>
double d_randtest_signed(flint_rand_t state, slong minexp, slong maxexp)source

Returns m 2^e, -m 2^e or zero with probability 1/3 each, where m is a value of d_randtest and e is uniform in [\mathit{minexp}, \mathit{maxexp}], so that a nonzero result has absolute value in [2^{e-1}, 2^e). Requires \mathit{minexp} \le \mathit{maxexp}; values outside the double range overflow to infinity or underflow (through ldexp).

Cite this page

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