diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-11-16 13:15:57 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-11-16 13:15:57 +0000 |
commit | 420cae89c0832226d16962aed081c57918d3ca69 (patch) | |
tree | c52dcd2f365380059a4f8b1bfefd66bdc683480c /src/mpfr-impl.h | |
parent | e4dfd1e1234f0de478d94623af79ad1737db698b (diff) | |
download | mpfr-420cae89c0832226d16962aed081c57918d3ca69.tar.gz |
[src/{int_ceil_log2.c,mpfr-impl.h}] Consistent postcondition for
MPFR_INT_CEIL_LOG2 and __gmpfr_int_ceil_log2 (result >= 0).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13270 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/mpfr-impl.h')
-rw-r--r-- | src/mpfr-impl.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mpfr-impl.h b/src/mpfr-impl.h index 6d447ab06..d5839657e 100644 --- a/src/mpfr-impl.h +++ b/src/mpfr-impl.h @@ -1450,7 +1450,9 @@ asm (".section predict_data, \"aw\"; .previous\n" _limb = (x) - 1; \ MPFR_ASSERTN (_limb == (x) - 1); \ count_leading_zeros (_b, _limb); \ - (GMP_NUMB_BITS - _b); })) + _b = GMP_NUMB_BITS - _b; \ + MPFR_ASSERTD (_b >= 0); \ + _b; })) #else # define MPFR_INT_CEIL_LOG2(x) \ (MPFR_UNLIKELY ((x) == 1) ? 0 : \ @@ -1461,6 +1463,7 @@ asm (".section predict_data, \"aw\"; .previous\n" _x = _x >> 1; \ _c ++; \ }; \ + MPFR_ASSERTD (_c >= 0); \ _c; })) #endif /* MPFR_LONG_WITHIN_LIMB */ #else |