diff options
Diffstat (limited to 'mul_2si.c')
-rw-r--r-- | mul_2si.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1,6 +1,6 @@ /* mpfr_mul_2si -- multiply a floating-point number by a power of two -Copyright 1999, 2001, 2002 Free Software Foundation, Inc. +Copyright 1999, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of the MPFR Library. @@ -33,22 +33,22 @@ mpfr_mul_2si (mpfr_ptr y, mpfr_srcptr x, long int n, mp_rnd_t rnd_mode) if (MPFR_IS_FP(y) && MPFR_NOTZERO(y)) { + mp_exp_t exp = MPFR_GET_EXP (y); if (n > 0 && (__gmpfr_emax < MPFR_EMIN_MIN + n || - MPFR_EXP(y) > __gmpfr_emax - n)) + exp > __gmpfr_emax - n)) return mpfr_set_overflow (y, rnd_mode, MPFR_SIGN(y)); if (n < 0 && (__gmpfr_emin > MPFR_EMAX_MAX + n || - MPFR_EXP(y) < __gmpfr_emin - n)) + exp < __gmpfr_emin - n)) { if (rnd_mode == GMP_RNDN && (__gmpfr_emin > MPFR_EMAX_MAX + (n + 1) || - MPFR_EXP(y) < __gmpfr_emin - (n + 1) || - mpfr_powerof2_raw (y))) + exp < __gmpfr_emin - (n + 1) || mpfr_powerof2_raw (y))) rnd_mode = GMP_RNDZ; return mpfr_set_underflow (y, rnd_mode, MPFR_SIGN(y)); } - MPFR_EXP(y) += n; + MPFR_SET_EXP (y, exp + n); } return inexact; |