diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2015-03-19 00:32:47 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2015-03-19 00:32:47 +0000 |
commit | 369d3ee696446f8815bcbb001daafd61dc65c655 (patch) | |
tree | c26a4f73dc69cfa0e0ad6e49ddf8cd58e5ddee8a | |
parent | 356ec8b85ea89dbee39da01ea519e9d91c9ac129 (diff) | |
download | mpfr-369d3ee696446f8815bcbb001daafd61dc65c655.tar.gz |
[src/sum.c] In the final rounding, forgot to handle the possible
exponent change in the negative case with corr == 2.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/new-sum@9341 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | src/sum.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -996,6 +996,13 @@ sum_aux (mpfr_ptr sum, mpfr_ptr *const x, unsigned long n, mpfr_rnd_t rnd, if (i < sn) mpn_com (sump + i, sump + i, sn - i); + else if (MPFR_UNLIKELY (MPFR_LIMB_MSB (sump[sn-1]) == 0)) + { + /* Happens on 01111...111, whose complement is + 10000...000, and com(x) - 1 is 01111...111. */ + sump[sn-1] |= MPFR_LIMB_HIGHBIT; + e--; + } } } |