summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2003-04-01 11:49:34 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2003-04-01 11:49:34 +0000
commitdb61d7b59fffb32799d5ec435e74bccd4e06a50a (patch)
tree53c0b109b746f0182949ff16bf5e8be9fc1dd044
parentede5a8d8e1dc63929f0503983d4c668a996e0632 (diff)
downloadmpfr-db61d7b59fffb32799d5ec435e74bccd4e06a50a.tar.gz
fixed pb with count_leading_zeros (n=0)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2286 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--exp_2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/exp_2.c b/exp_2.c
index a46695ad9..44091eb01 100644
--- a/exp_2.c
+++ b/exp_2.c
@@ -117,7 +117,10 @@ mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode)
n = (int) (mpfr_get_d1 (x) / LOG2);
/* error bounds the cancelled bits in x - n*log(2) */
- count_leading_zeros (error_r, (mp_limb_t) (n < 0) ? -n : n);
+ if (n == 0)
+ error_r = 0;
+ else
+ count_leading_zeros (error_r, (mp_limb_t) (n < 0) ? -n : n);
error_r = BITS_PER_MP_LIMB - error_r + 2;
/* for the O(n^(1/2)*M(n)) method, the Taylor series computation of