diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-09-30 09:06:37 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-09-30 09:06:37 +0000 |
commit | b2b713868a0c48adcc5137eed3b40b371ee1bad1 (patch) | |
tree | b9015988bf771315d4dc57787c2abce70a184177 | |
parent | 8a3fe5601f0c0d4da5a89cdc22bf1481086d0158 (diff) | |
download | mpfr-b2b713868a0c48adcc5137eed3b40b371ee1bad1.tar.gz |
The real fix for sizeof(intmax_t) == sizeof(mp_limb_t).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3013 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | get_sj.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -79,7 +79,7 @@ mpfr_get_sj (mpfr_srcptr f, mpfr_rnd_t rnd) xp = MPFR_MANT (x); sh = MPFR_GET_EXP (x); MPFR_ASSERTN ((mp_prec_t) sh <= prec); - if (INTMAX_MIN + INTMAX_MAX != 0 + if (INTMAX_MIN + INTMAX_MAX != 0 && MPFR_UNLIKELY ((mp_prec_t) sh == prec)) { /* 2's complement and x <= INTMAX_MIN: in the case mp_limb_t @@ -94,9 +94,9 @@ mpfr_get_sj (mpfr_srcptr f, mpfr_rnd_t rnd) for (n = MPFR_LIMB_SIZE (x) - 1; n >= 0; n--) { sh -= BITS_PER_MP_LIMB; - r += (sh >= 0 - ? (uintmax_t) xp[n] << sh - : (uintmax_t) xp[n] >> (-sh)); + r += (sh >= 0 + ? (intmax_t) xp[n] << sh + : (intmax_t) ((uintmax_t) xp[n] >> (-sh))); } } else @@ -105,8 +105,8 @@ mpfr_get_sj (mpfr_srcptr f, mpfr_rnd_t rnd) { sh -= BITS_PER_MP_LIMB; r -= (sh >= 0 - ? (uintmax_t) xp[n] << sh - : (uintmax_t) xp[n] >> (-sh)); + ? (intmax_t) xp[n] << sh + : (intmax_t) ((uintmax_t) xp[n] >> (-sh))); } } } |