summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/texp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/texp.c b/tests/texp.c
index 6d49e1211..e67634001 100644
--- a/tests/texp.c
+++ b/tests/texp.c
@@ -170,7 +170,9 @@ compare_exp2_exp3 (mpfr_prec_t p0, mpfr_prec_t p1)
mpfr_set_prec (x, prec);
mpfr_set_prec (y, prec);
mpfr_set_prec (z, prec);
- mpfr_urandomb (x, RANDS);
+ do
+ mpfr_urandomb (x, RANDS);
+ while (MPFR_IS_ZERO (x)); /* 0 is handled by mpfr_exp only */
rnd = RND_RAND ();
mpfr_exp_2 (y, x, rnd);
mpfr_exp_3 (z, x, rnd);