diff options
Diffstat (limited to 'Build/source/libs/mpfr/mpfr-src/src/div_2si.c')
-rw-r--r-- | Build/source/libs/mpfr/mpfr-src/src/div_2si.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Build/source/libs/mpfr/mpfr-src/src/div_2si.c b/Build/source/libs/mpfr/mpfr-src/src/div_2si.c index c7da6a05849..b3c877543ab 100644 --- a/Build/source/libs/mpfr/mpfr-src/src/div_2si.c +++ b/Build/source/libs/mpfr/mpfr-src/src/div_2si.c @@ -1,7 +1,7 @@ /* mpfr_div_2si -- divide 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. @@ -45,11 +45,12 @@ mpfr_div_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)); } - else if (MPFR_UNLIKELY(n < 0 && (__gmpfr_emax < MPFR_EMIN_MIN - n || + else if (MPFR_UNLIKELY(n <= 0 && (__gmpfr_emax < MPFR_EMIN_MIN - n || exp > __gmpfr_emax + n)) ) return mpfr_overflow (y, rnd_mode, MPFR_SIGN(y)); |