summaryrefslogtreecommitdiff
path: root/src/exp_2.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2014-11-12 08:35:49 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2014-11-12 08:35:49 +0000
commit93c41479cf61eb05eb1cc9920788dc92f6c069f3 (patch)
tree66886ceeba85ef78cc32f67c52037cedbdc7f354 /src/exp_2.c
parent92b78558af10c0a31504b4991f07779b2be1d7cf (diff)
downloadmpfr-93c41479cf61eb05eb1cc9920788dc92f6c069f3.tar.gz
[src/exp_2.c] Improved t = 0 test.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9236 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/exp_2.c')
-rw-r--r--src/exp_2.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/exp_2.c b/src/exp_2.c
index dcfc3a8d0..d71f3ad55 100644
--- a/src/exp_2.c
+++ b/src/exp_2.c
@@ -298,8 +298,6 @@ mpfr_exp2_aux (mpz_t s, mpfr_srcptr r, mpfr_prec_t q, mpfr_exp_t *exps)
/* truncates the bits of t which are < ulp(s) = 2^(1-q) */
expt += mpz_normalize (t, t, (mpfr_exp_t) q - dif);
/* error at most 2^(1-q) */
- if (mpz_sgn (t) == 0)
- break;
if (l > 1)
{
/* GMP doesn't optimize the case of power of 2 */
@@ -314,9 +312,9 @@ mpfr_exp2_aux (mpz_t s, mpfr_srcptr r, mpfr_prec_t q, mpfr_exp_t *exps)
}
/* the error wrt t^l/l! is here at most 3*l*ulp(s) */
MPFR_ASSERTD (expt == *exps);
- if (mpz_sgn (t) == 0)
- break;
}
+ if (mpz_sgn (t) == 0)
+ break;
mpz_add (s, s, t); /* no error here: exact */
/* ensures rr has the same size as t: after several shifts, the error
on rr is still at most ulp(t)=ulp(s) */