diff options
Diffstat (limited to 'src/rem1.c')
-rw-r--r-- | src/rem1.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rem1.c b/src/rem1.c index 3a7173c24..0ac742749 100644 --- a/src/rem1.c +++ b/src/rem1.c @@ -100,9 +100,11 @@ mpfr_rem1 (mpfr_ptr rem, long *quo, mpfr_rnd_t rnd_q, mpz_abs (my, my); q_is_odd = 0; - /* divide my by 2^k if possible to make operations mod my easier */ + /* Divide my by 2^k if possible to make operations mod my easier. + Since my comes from a regular MPFR number, due to the constraints on the + exponent and the precision, there can be no integer overflow below. */ { - unsigned long k = mpz_scan1 (my, 0); + mpfr_exp_t k = mpz_scan1 (my, 0); ey += k; mpz_fdiv_q_2exp (my, my, k); } |