summaryrefslogtreecommitdiff
path: root/Build/source/libs/mpfr/mpfr-src/src/round_p.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/mpfr/mpfr-src/src/round_p.c')
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/round_p.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/Build/source/libs/mpfr/mpfr-src/src/round_p.c b/Build/source/libs/mpfr/mpfr-src/src/round_p.c
index bf12defd7ee..f19a66433f5 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/round_p.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/round_p.c
@@ -1,7 +1,7 @@
/* mpfr_round_p -- check if an approximation is roundable.
-Copyright 2005-2015 Free Software Foundation, Inc.
-Contributed by the AriC and Caramel projects, INRIA.
+Copyright 2005-2016 Free Software Foundation, Inc.
+Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -31,7 +31,11 @@ mpfr_round_p (mp_limb_t *bp, mp_size_t bn, mpfr_exp_t err0, mpfr_prec_t prec)
{
int i1, i2;
+ MPFR_ASSERTN(bp[bn - 1] & MPFR_LIMB_HIGHBIT);
+
i1 = mpfr_round_p_2 (bp, bn, err0, prec);
+
+ /* compare with mpfr_can_round_raw */
i2 = mpfr_can_round_raw (bp, bn, MPFR_SIGN_POS, err0,
MPFR_RNDN, MPFR_RNDZ, prec);
if (i1 != i2)
@@ -42,6 +46,7 @@ mpfr_round_p (mp_limb_t *bp, mp_size_t bn, mpfr_exp_t err0, mpfr_prec_t prec)
gmp_fprintf (stderr, "%NX\n", bp, bn);
MPFR_ASSERTN (0);
}
+
return i1;
}
# define mpfr_round_p mpfr_round_p_2
@@ -62,6 +67,8 @@ mpfr_round_p (mp_limb_t *bp, mp_size_t bn, mpfr_exp_t err0, mpfr_prec_t prec)
mp_limb_t tmp, mask;
int s;
+ MPFR_ASSERTD(bp[bn - 1] & MPFR_LIMB_HIGHBIT);
+
err = (mpfr_prec_t) bn * GMP_NUMB_BITS;
if (MPFR_UNLIKELY (err0 <= 0 || (mpfr_uexp_t) err0 <= prec || prec >= err))
return 0; /* can't round */