summaryrefslogtreecommitdiff
path: root/tests/tsum.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2011-01-26 14:06:39 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2011-01-26 14:06:39 +0000
commit2ceda3bf57ea8aac3bdcb6e45d6ce66bcd8130a6 (patch)
treeb5a6c43c92b4e3c011c12eef307f528d024f8a47 /tests/tsum.c
parent5e1ff8c842b15d6a442805a523308de1f4b9f21d (diff)
downloadmpfr-2ceda3bf57ea8aac3bdcb6e45d6ce66bcd8130a6.tar.gz
[tests/tsum.c] Fixed bug in test (do not set the exponent on 0).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7431 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tsum.c')
-rw-r--r--tests/tsum.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/tsum.c b/tests/tsum.c
index 122a6cd8a..44d75e4f6 100644
--- a/tests/tsum.c
+++ b/tests/tsum.c
@@ -193,7 +193,8 @@ test_sum (mpfr_prec_t f, unsigned long n)
for (i = 0; i < n; i++)
{
mpfr_urandomb (tab[i], RANDS);
- mpfr_set_exp (tab[i], randlimb () % 1000);
+ if (! mpfr_zero_p (tab[i]))
+ mpfr_set_exp (tab[i], randlimb () % 1000);
}
algo_exact (real_non_rounded, tab, n, f);
for (rnd_mode = 0; rnd_mode < MPFR_RND_MAX; rnd_mode++)