summaryrefslogtreecommitdiff
path: root/exp_2.c
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2005-03-04 17:40:53 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2005-03-04 17:40:53 +0000
commitca8aadf5c9ea5351151e8c7425d27388a4d7e5dc (patch)
treefba0ba2ff07c59bd6de66f18c8f53200eb1f32ee /exp_2.c
parent7c2a4276339fe8771cc879c9aa31139b90e6c3e1 (diff)
downloadmpfr-ca8aadf5c9ea5351151e8c7425d27388a4d7e5dc.tar.gz
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
Diffstat (limited to 'exp_2.c')
-rw-r--r--exp_2.c2
1 files changed, 1 insertions, 1 deletions
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);