From ca8aadf5c9ea5351151e8c7425d27388a4d7e5dc Mon Sep 17 00:00:00 2001 From: pelissip Date: Fri, 4 Mar 2005 17:40:53 +0000 Subject: Fix bug due to wrong estimation of (get_d (x) / LOG2). TODO: Rexamine the algorithm of mpfr_exp_2! git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3362 280ebfd0-de03-0410-8827-d642c229c3f4 --- exp_2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'exp_2.c') diff --git a/exp_2.c b/exp_2.c index e9175d16b..f1cf47495 100644 --- a/exp_2.c +++ b/exp_2.c @@ -144,7 +144,7 @@ mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) mpfr_sub (r, x, r, GMP_RNDU); /* possible cancellation here: the error on r is at most 3*2^(EXP(old_r)-EXP(new_r)) */ - if (MPFR_IS_NEG (r)) + while (MPFR_IS_NEG (r)) { /* initial approximation n was too large */ n--; mpfr_add (r, r, s, GMP_RNDU); -- cgit v1.2.1