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 m2em 2^e, −m2e-m 2^e or zero with probability 1/3 each, where mm is a value of d_randtest and ee is uniform in [minexp,maxexp][\mathit{minexp}, \mathit{maxexp}], so that a nonzero result has absolute value in [2e−1,2e)[2^{e-1}, 2^e). Requires minexp≤maxexp\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-11-02).