summaryrefslogtreecommitdiff
path: root/src/div_2si.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/div_2si.c')
-rw-r--r--src/div_2si.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/div_2si.c b/src/div_2si.c
index 4220bcfae..140713f92 100644
--- a/src/div_2si.c
+++ b/src/div_2si.c
@@ -45,7 +45,8 @@ 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));
}