summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cos.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cos.c b/src/cos.c
index 8f58e8e85..7336bb860 100644
--- a/src/cos.c
+++ b/src/cos.c
@@ -64,7 +64,9 @@ mpfr_cos2_aux (mpfr_ptr f, mpfr_srcptr r)
mpz_init (t);
ex = mpfr_get_z_2exp (x, r); /* r = x*2^ex */
- /* remove trailing zeroes */
+ /* Remove trailing zeroes.
+ Since x comes from a MPFR number, due to the constrainst on the exponent
+ and the precision, there can be no integer overflow below. */
l = mpz_scan1 (x, 0);
ex += l;
mpz_fdiv_q_2exp (x, x, l);