diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-01-28 13:27:09 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-01-28 13:27:09 +0000 |
commit | 1f198c2b91b8cbd1f28b31bab5df8f24bd855615 (patch) | |
tree | 8d9360014c27f4448ba2e76b9b2867c7d9f19ce5 | |
parent | d27812d6ff0ed5f8b902bba256996d8d400b4317 (diff) | |
download | mpfr-1f198c2b91b8cbd1f28b31bab5df8f24bd855615.tar.gz |
[src/round_p.c] Added an assertion (similar to what was added to
mpfr_can_round_raw). This triggers failures, which could also be
detected with MPFR_WANT_ASSERT >= 2.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9886 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | src/round_p.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/round_p.c b/src/round_p.c index 26232d5c9..2e7a49854 100644 --- a/src/round_p.c +++ b/src/round_p.c @@ -60,6 +60,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 */ |