summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2018-09-06 07:56:44 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2018-09-06 07:56:44 +0000
commitf289c916580b4d594fc6d66ce21765007b9d0569 (patch)
tree28aac7c343d03d8801dbbbf32449edded8e6bf0b
parent6b26752e22aa7d117c92934f97e653b6197ced14 (diff)
downloadmpfr-f289c916580b4d594fc6d66ce21765007b9d0569.tar.gz
[src/rint.c] fixed bug with 16-bit limb
(found by trint with GMP_CHECK_RANDOMIZE=1536206745598891) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13150 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--src/rint.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rint.c b/src/rint.c
index 090b41e0d..a2c01d62b 100644
--- a/src/rint.c
+++ b/src/rint.c
@@ -191,7 +191,7 @@ mpfr_rint (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode)
}
if (uflags == 0)
{ /* u is an integer; determine if it is representable in r */
- if (sh != 0 && rp[0] << (GMP_NUMB_BITS - sh) != 0)
+ if (sh != 0 && MPFR_LIMB_LSHIFT(rp[0], GMP_NUMB_BITS - sh) != 0)
uflags = 1; /* u is not representable in r */
else
{
@@ -288,7 +288,7 @@ mpfr_rint (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode)
MPFR_RET(0);
MPFR_ASSERTD (rnd_away >= 0); /* rounding direction is defined */
- if (rnd_away && mpn_add_1(rp, rp, rn, MPFR_LIMB_ONE << sh))
+ if (rnd_away && mpn_add_1 (rp, rp, rn, MPFR_LIMB_ONE << sh))
{
if (exp == __gmpfr_emax)
return mpfr_overflow (r, rnd_mode, sign) >= 0 ?