summaryrefslogtreecommitdiff
path: root/Build/source/libs/mpfr/mpfr-src/src/sub1sp.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/mpfr/mpfr-src/src/sub1sp.c')
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/sub1sp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Build/source/libs/mpfr/mpfr-src/src/sub1sp.c b/Build/source/libs/mpfr/mpfr-src/src/sub1sp.c
index 5632afff053..2fc19db1d33 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/sub1sp.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/sub1sp.c
@@ -1,7 +1,7 @@
/* mpfr_sub1sp -- internal function to perform a "real" subtraction
All the op must have the same precision
-Copyright 2003-2018 Free Software Foundation, Inc.
+Copyright 2003-2019 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -18,7 +18,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
-http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
+https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
#define MPFR_NEED_LONGLONG_H
@@ -375,13 +375,15 @@ mpfr_sub1sp1n (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
}
else /* cases (a), (c), (d) and (e) */
{
- ap[0] = -MPFR_LIMB_ONE;
/* rb=1 in case (e) and case (c) */
rb = d > GMP_NUMB_BITS + 1
|| (d == GMP_NUMB_BITS + 1 && cp[0] == MPFR_LIMB_HIGHBIT);
/* sb = 1 in case (d) and (e) */
sb = d > GMP_NUMB_BITS + 1
|| (d == GMP_NUMB_BITS + 1 && cp[0] > MPFR_LIMB_HIGHBIT);
+ /* Warning: only set ap[0] last, otherwise in case ap=cp,
+ the above comparisons involving cp[0] would be wrong */
+ ap[0] = -MPFR_LIMB_ONE;
}
}
}