diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-04-01 11:49:34 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-04-01 11:49:34 +0000 |
commit | db61d7b59fffb32799d5ec435e74bccd4e06a50a (patch) | |
tree | 53c0b109b746f0182949ff16bf5e8be9fc1dd044 | |
parent | ede5a8d8e1dc63929f0503983d4c668a996e0632 (diff) | |
download | mpfr-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.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 |