summaryrefslogtreecommitdiff
path: root/src/add1.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/add1.c')
-rw-r--r--src/add1.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/add1.c b/src/add1.c
index ac654367a..524c96f29 100644
--- a/src/add1.c
+++ b/src/add1.c
@@ -44,12 +44,12 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
bq = MPFR_PREC(b);
cq = MPFR_PREC(c);
- an = (aq-1)/GMP_NUMB_BITS+1; /* number of limbs of a */
+ an = MPFR_PREC2LIMBS (aq); /* number of limbs of a */
aq2 = (mpfr_prec_t) an * GMP_NUMB_BITS;
sh = aq2 - aq; /* non-significant bits in low limb */
- bn = (bq-1)/GMP_NUMB_BITS+1; /* number of limbs of b */
- cn = (cq-1)/GMP_NUMB_BITS+1; /* number of limbs of c */
+ bn = MPFR_PREC2LIMBS (bq); /* number of limbs of b */
+ cn = MPFR_PREC2LIMBS (cq); /* number of limbs of c */
ap = MPFR_MANT(a);
bp = MPFR_MANT(b);
@@ -124,7 +124,7 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
dif = aq2 - diff_exp;
/* dif is the number of bits of c which overlap with a' */
- difn = (dif-1)/GMP_NUMB_BITS + 1;
+ difn = MPFR_PREC2LIMBS (dif);
/* only the highest difn limbs from c have to be considered */
if (MPFR_UNLIKELY(difn > cn))
{