summaryrefslogtreecommitdiff
path: root/Build/source/libs/mpfr/mpfr-src/src/mul_2si.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/mpfr/mpfr-src/src/mul_2si.c')
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mul_2si.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mul_2si.c b/Build/source/libs/mpfr/mpfr-src/src/mul_2si.c
index b9293e2a1f3..04fdee403f6 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mul_2si.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/mul_2si.c
@@ -1,7 +1,7 @@
/* mpfr_mul_2si -- multiply a floating-point number by a power of two
-Copyright 1999, 2001-2015 Free Software Foundation, Inc.
-Contributed by the AriC and Caramel projects, INRIA.
+Copyright 1999, 2001-2016 Free Software Foundation, Inc.
+Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -39,7 +39,7 @@ mpfr_mul_2si (mpfr_ptr y, mpfr_srcptr x, long int n, mpfr_rnd_t rnd_mode)
{
mpfr_exp_t exp = MPFR_GET_EXP (x);
MPFR_SETRAW (inexact, y, x, exp, rnd_mode);
- if (MPFR_UNLIKELY( n > 0 && (__gmpfr_emax < MPFR_EMIN_MIN + n ||
+ if (MPFR_UNLIKELY(n >= 0 && (__gmpfr_emax < MPFR_EMIN_MIN + n ||
exp > __gmpfr_emax - n)))
return mpfr_overflow (y, rnd_mode, MPFR_SIGN(y));
else if (MPFR_UNLIKELY(n < 0 && (__gmpfr_emin > MPFR_EMAX_MAX + n ||
@@ -48,7 +48,8 @@ mpfr_mul_2si (mpfr_ptr y, mpfr_srcptr x, long int n, mpfr_rnd_t rnd_mode)
if (rnd_mode == MPFR_RNDN &&
(__gmpfr_emin > MPFR_EMAX_MAX + (n + 1) ||
exp < __gmpfr_emin - (n + 1) ||
- (inexact >= 0 && mpfr_powerof2_raw (y))))
+ ((MPFR_IS_NEG (y) ? inexact <= 0 : inexact >= 0) &&
+ mpfr_powerof2_raw (y))))
rnd_mode = MPFR_RNDZ;
return mpfr_underflow (y, rnd_mode, MPFR_SIGN(y));
}