diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-01-15 09:59:26 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-01-15 09:59:26 +0000 |
commit | c2b53485bf1ebeada34f65dc588432a7c0f4bb57 (patch) | |
tree | 31d1f3c9373d34fe86621278f57ed894b5fd9b4a /src/log_ui.c | |
parent | 5cff5a70a10cc293249e585ccf4d3c891312b9ba (diff) | |
download | mpfr-c2b53485bf1ebeada34f65dc588432a7c0f4bb57.tar.gz |
[src/log_ui.c] Replaced a comment by an assertion.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9812 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/log_ui.c')
-rw-r--r-- | src/log_ui.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/log_ui.c b/src/log_ui.c index 7651dfdb0..9c8e09699 100644 --- a/src/log_ui.c +++ b/src/log_ui.c @@ -107,7 +107,8 @@ mpfr_log_ui (mpfr_ptr x, unsigned long n, mpfr_rnd_t rnd_mode) /* argument reduction: compute k such that 2/3 <= n/2^k < 4/3, i.e., 2^(k+1) <= 3n < 2^(k+2) */ - k = __gmpfr_ceil_log2 (3.0 * (double) n) - 2; /* k >= 2 */ + k = __gmpfr_ceil_log2 (3.0 * (double) n) - 2; + MPFR_ASSERTD (k >= 2); /* the reduced argument is n/2^k - 1 = (n-2^k)/2^k */ p = (long) n - (1L << k); /* FIXME: integer overflow for large n */ |