summaryrefslogtreecommitdiff
path: root/src/log_ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/log_ui.c')
-rw-r--r--src/log_ui.c3
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 */