summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--acos.c4
-rw-r--r--acosh.c3
-rw-r--r--agm.c3
-rw-r--r--asin.c4
-rw-r--r--asinh.c3
-rw-r--r--atan.c4
-rw-r--r--atanh.c3
-rw-r--r--const_euler.c3
-rw-r--r--const_pi.c3
-rw-r--r--cos.c3
-rw-r--r--cosh.c5
-rw-r--r--erf.c3
-rw-r--r--exp2.c3
-rw-r--r--exp_2.c3
-rw-r--r--expm1.c3
-rw-r--r--gmp_op.c6
-rw-r--r--hypot.c3
-rw-r--r--log.c3
-rw-r--r--log10.c3
-rw-r--r--log1p.c3
-rw-r--r--log2.c3
-rw-r--r--mul.c6
-rw-r--r--pow.c3
-rw-r--r--pow_si.c3
-rw-r--r--pow_ui.c3
-rw-r--r--pow_z.c6
-rw-r--r--sinh.c3
-rw-r--r--tan.c3
-rw-r--r--tanh.c3
-rw-r--r--ui_pow_ui.c3
-rw-r--r--zeta.c10
31 files changed, 41 insertions, 73 deletions
diff --git a/acos.c b/acos.c
index 68db18230..35e6c271a 100644
--- a/acos.c
+++ b/acos.c
@@ -110,8 +110,8 @@ mpfr_acos (mpfr_ptr acos, mpfr_srcptr x, mp_rnd_t rnd_mode)
mpfr_div_2ui (tmp, tmp, 1, GMP_RNDN);
mpfr_sub (arcc, tmp, arcc, GMP_RNDN);
- if (mpfr_can_round (arcc, prec-supplement, GMP_RNDN, GMP_RNDZ,
- MPFR_PREC (acos) + (rnd_mode == GMP_RNDN)))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (arcc, prec-supplement,
+ MPFR_PREC (acos), rnd_mode)))
break;
MPFR_ZIV_NEXT (loop, prec);
mpfr_set_prec (tmp, prec);
diff --git a/acosh.c b/acosh.c
index 3a876a70c..06f4783dc 100644
--- a/acosh.c
+++ b/acosh.c
@@ -101,8 +101,7 @@ mpfr_acosh (mpfr_ptr y, mpfr_srcptr x , mp_rnd_t rnd_mode)
err = Nt - (-1 + 2 * MAX (2 + MAX (2 - MPFR_GET_EXP (t),
1 + exp_te - exp_ti
- MPFR_GET_EXP (t)), 0));
- if (MPFR_LIKELY (mpfr_can_round (t, err, GMP_RNDN, GMP_RNDZ,
- Ny + (rnd_mode == GMP_RNDN))))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (t, err, Ny, rnd_mode)))
break;
/* reactualisation of the precision */
diff --git a/agm.c b/agm.c
index 69f85e3bd..be691354c 100644
--- a/agm.c
+++ b/agm.c
@@ -146,8 +146,7 @@ mpfr_agm (mpfr_ptr r, mpfr_srcptr op2, mpfr_srcptr op1, mp_rnd_t rnd_mode)
mpfr_swap (v, tmp);
}
/* Roundability of the result */
- if (MPFR_LIKELY (mpfr_can_round (v, p - 4 - 3, GMP_RNDN, GMP_RNDZ,
- q + (rnd_mode == GMP_RNDN))))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (v, p - 4 - 3, q, rnd_mode)))
break; /* Stop the loop */
/* Next iteration */
diff --git a/asin.c b/asin.c
index 5c3902657..ae36f4715 100644
--- a/asin.c
+++ b/asin.c
@@ -106,8 +106,8 @@ mpfr_asin (mpfr_ptr asin, mpfr_srcptr x, mp_rnd_t rnd_mode)
mpfr_sqrt (xp, xp, GMP_RNDN);
mpfr_div (xp, x, xp, GMP_RNDN);
mpfr_atan (xp, xp, GMP_RNDN);
- if (mpfr_can_round (xp, prec - xp_exp, GMP_RNDN, GMP_RNDZ,
- MPFR_PREC (asin) + (rnd_mode == GMP_RNDN)))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (xp, prec - xp_exp,
+ MPFR_PREC (asin), rnd_mode)))
break;
MPFR_ZIV_NEXT (loop, prec);
}
diff --git a/asinh.c b/asinh.c
index 70d62a6ef..54912ea82 100644
--- a/asinh.c
+++ b/asinh.c
@@ -95,8 +95,7 @@ mpfr_asinh (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode)
err = Nt - (MAX (3 - MPFR_GET_EXP (t), 0) + 1);
if (MPFR_LIKELY (MPFR_IS_ZERO (t)
- || mpfr_can_round (t, err, GMP_RNDN, GMP_RNDZ,
- Ny + (rnd_mode == GMP_RNDN))))
+ || MPFR_CAN_ROUND (t, err, Ny, rnd_mode)))
break;
/* actualisation of the precision */
diff --git a/atan.c b/atan.c
index 7def1edc6..5694ea688 100644
--- a/atan.c
+++ b/atan.c
@@ -350,8 +350,8 @@ mpfr_atan (mpfr_ptr atan, mpfr_srcptr x, mp_rnd_t rnd_mode)
}
MPFR_SET_POS (arctgt);
- if (mpfr_can_round (arctgt, realprec, GMP_RNDN, GMP_RNDZ,
- MPFR_PREC (atan) + (rnd_mode == GMP_RNDN)))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (arctgt, realprec, MPFR_PREC (atan),
+ rnd_mode)))
break;
MPFR_ZIV_NEXT (loop, realprec);
}
diff --git a/atanh.c b/atanh.c
index af9c98fb8..f7b26c890 100644
--- a/atanh.c
+++ b/atanh.c
@@ -103,8 +103,7 @@ mpfr_atanh (mpfr_ptr y, mpfr_srcptr xt , mp_rnd_t rnd_mode)
err = Nt - (MAX (4 - MPFR_GET_EXP (t), 0) + 1);
if (MPFR_LIKELY (MPFR_IS_ZERO (t)
- || mpfr_can_round (t, err, GMP_RNDN, GMP_RNDZ,
- Ny + (rnd_mode == GMP_RNDN))))
+ || MPFR_CAN_ROUND (t, err, Ny, rnd_mode)))
break;
/* reactualisation of the precision */
diff --git a/const_euler.c b/const_euler.c
index d96e42627..2b9666cfc 100644
--- a/const_euler.c
+++ b/const_euler.c
@@ -64,8 +64,7 @@ mpfr_const_euler_internal (mpfr_t x, mp_rnd_t rnd)
mpfr_set_prec (z, m - log2m);
mpfr_const_euler_R (z, n);
mpfr_sub (y, y, z, GMP_RNDN);
- if (MPFR_LIKELY (mpfr_can_round (y, m - 3, GMP_RNDN, GMP_RNDZ,
- prec + (rnd == GMP_RNDN))))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (y, m - 3, prec, rnd)))
break;
MPFR_ZIV_NEXT (loop, m);
mpfr_set_prec (y, m);
diff --git a/const_pi.c b/const_pi.c
index c2ae870ed..4e3237de6 100644
--- a/const_pi.c
+++ b/const_pi.c
@@ -93,8 +93,7 @@ mpfr_const_pi_internal (mpfr_ptr x, mp_rnd_t rnd_mode)
mpfr_div (A, B, D, GMP_RNDN);
/* MPFR_ASSERTN(p >= 2 * k + 8); */
- if (MPFR_LIKELY (mpfr_can_round (A, p - 2 * k - 8, GMP_RNDN, GMP_RNDZ,
- px + (rnd_mode == GMP_RNDN))))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (A, p - 2 * k - 8, px, rnd_mode)))
break;
p += kmax;
diff --git a/cos.c b/cos.c
index dd0153f57..5e539953a 100644
--- a/cos.c
+++ b/cos.c
@@ -135,8 +135,7 @@ mpfr_cos (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode)
/* now the error is bounded by 2^(k-m) = 2^(EXP(s)-err) */
exps = MPFR_GET_EXP(s);
- if (MPFR_LIKELY(mpfr_can_round (s, exps + m - k, GMP_RNDN, GMP_RNDZ,
- precy + (rnd_mode == GMP_RNDN))))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (s, exps + m - k, precy, rnd_mode)))
break;
if (MPFR_UNLIKELY (exps == 1))
diff --git a/cosh.c b/cosh.c
index 0a561450b..aaab06c0d 100644
--- a/cosh.c
+++ b/cosh.c
@@ -94,9 +94,8 @@ mpfr_cosh (mpfr_ptr y, mpfr_srcptr xt , mp_rnd_t rnd_mode)
err = Nt - 3;
/* Check if we can round */
- if (MPFR_UNLIKELY(MPFR_IS_INF(t)) ||
- mpfr_can_round (t, err, GMP_RNDN, GMP_RNDZ,
- Ny + (rnd_mode == GMP_RNDN)))
+ if (MPFR_UNLIKELY (MPFR_IS_INF (t))
+ || MPFR_LIKELY (MPFR_CAN_ROUND (t, err, Ny, rnd_mode)))
break;
/* Actualisation of the precision */
diff --git a/erf.c b/erf.c
index b67adb3cc..d256c2b70 100644
--- a/erf.c
+++ b/erf.c
@@ -172,8 +172,7 @@ mpfr_erf_0 (mpfr_ptr res, mpfr_srcptr x, double xf2, mp_rnd_t rnd_mode)
tauk = 4.0 * tauk + 11.0; /* final ulp-error on s */
log2tauk = __gmpfr_ceil_log2 (tauk);
- if (MPFR_LIKELY (mpfr_can_round (s, m - log2tauk, GMP_RNDN, GMP_RNDZ,
- n + (rnd_mode == GMP_RNDN))))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (s, m - log2tauk, n, rnd_mode)))
break;
/* Actualisation of the precision */
diff --git a/exp2.c b/exp2.c
index 4adf45e38..62ca7a7fc 100644
--- a/exp2.c
+++ b/exp2.c
@@ -116,8 +116,7 @@ mpfr_exp2 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode)
err = Nt - (MPFR_GET_EXP (t) + 2); /* Estimate of the error */
mpfr_exp (t, t, GMP_RNDN); /* exp(x*ln(2))*/
- if (MPFR_LIKELY (mpfr_can_round (t, err, GMP_RNDN, GMP_RNDZ,
- Ny + (rnd_mode == GMP_RNDN))))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (t, err, Ny, rnd_mode)))
break;
/* Actualisation of the precision */
diff --git a/exp_2.c b/exp_2.c
index f1cf47495..77160c4b3 100644
--- a/exp_2.c
+++ b/exp_2.c
@@ -184,8 +184,7 @@ mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode)
MPFR_LOG_VAR (s);
MPFR_LOG_MSG (("err=%d bits\n", K));
- if (mpfr_can_round (s, q - K, GMP_RNDN, GMP_RNDZ,
- precy + (rnd_mode == GMP_RNDN)) )
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (s, q-K, precy, rnd_mode)))
break;
MPFR_ZIV_NEXT (loop, q);
mpfr_set_prec (r, q);
diff --git a/expm1.c b/expm1.c
index be33600b0..46dd28036 100644
--- a/expm1.c
+++ b/expm1.c
@@ -93,8 +93,7 @@ mpfr_expm1 (mpfr_ptr y, mpfr_srcptr x , mp_rnd_t rnd_mode)
/*err=Nt-(__gmpfr_ceil_log2(1+pow(2,MPFR_EXP(te)-MPFR_EXP(t))));*/
err = Nt - (MAX (exp_te - MPFR_GET_EXP (t), 0) + 1);
- if (MPFR_LIKELY (mpfr_can_round (t, err, GMP_RNDN, GMP_RNDZ,
- Ny + (rnd_mode == GMP_RNDN))))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (t, err, Ny, rnd_mode)))
break;
/* actualisation of the precision */
diff --git a/gmp_op.c b/gmp_op.c
index 961071db0..5be8f3e46 100644
--- a/gmp_op.c
+++ b/gmp_op.c
@@ -196,8 +196,7 @@ mpfr_add_q (mpfr_ptr y, mpfr_srcptr x, mpq_srcptr z, mp_rnd_t rnd_mode)
if (MPFR_LIKELY (!MPFR_IS_ZERO (t)))
{
err = (mp_exp_t) p - 1 - MAX (MPFR_GET_EXP(q)-MPFR_GET_EXP(t), 0);
- if (MPFR_LIKELY (mpfr_can_round (t, err, GMP_RNDN, GMP_RNDZ,
- MPFR_PREC(y) + (rnd_mode == GMP_RNDN))))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (t, err, MPFR_PREC (y), rnd_mode)))
{
res = mpfr_set (y, t, rnd_mode);
break;
@@ -275,8 +274,7 @@ mpfr_sub_q (mpfr_ptr y, mpfr_srcptr x, mpq_srcptr z,mp_rnd_t rnd_mode)
if (MPFR_LIKELY (!MPFR_IS_ZERO (t)))
{
err = (mp_exp_t) p - 1 - MAX (MPFR_GET_EXP(q)-MPFR_GET_EXP(t), 0);
- res = mpfr_can_round (t, err, GMP_RNDN, GMP_RNDZ,
- MPFR_PREC(y) + (rnd_mode == GMP_RNDN) );
+ res = MPFR_CAN_ROUND (t, err, MPFR_PREC (y), rnd_mode);
if (MPFR_LIKELY (res != 0)) /* We can round! */
{
res = mpfr_set (y, t, rnd_mode);
diff --git a/hypot.c b/hypot.c
index 0373d1e31..cf5d9dd60 100644
--- a/hypot.c
+++ b/hypot.c
@@ -130,8 +130,7 @@ mpfr_hypot (mpfr_ptr z, mpfr_srcptr x , mpfr_srcptr y , mp_rnd_t rnd_mode)
exact |= mpfr_sqrt (t, t, GMP_RNDZ); /* sqrt(x^2+y^2)*/
if (MPFR_LIKELY (exact == 0
- || mpfr_can_round (t, Nt - 2, GMP_RNDN, GMP_RNDZ,
- Nz + (rnd_mode == GMP_RNDN))))
+ || MPFR_CAN_ROUND (t, Nt-2, Nz, rnd_mode)))
break;
/* reactualization of the precision */
diff --git a/log.c b/log.c
index e53b608a5..8e909b401 100644
--- a/log.c
+++ b/log.c
@@ -148,8 +148,7 @@ mpfr_log (mpfr_ptr r, mpfr_srcptr a, mp_rnd_t rnd_mode)
/* we have 7 ulps of error from the above roundings,
4 ulps from the 4/s^2 second order term,
plus the canceled bits */
- if (MPFR_LIKELY (mpfr_can_round (tmp1, p - cancel - 4, GMP_RNDN,
- GMP_RNDZ, q + (rnd_mode == GMP_RNDN))))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (tmp1, p-cancel-4, q, rnd_mode)))
break;
p += cancel;
MPFR_ZIV_NEXT (loop, p);
diff --git a/log10.c b/log10.c
index 571edc7c0..5f97708c3 100644
--- a/log10.c
+++ b/log10.c
@@ -113,8 +113,7 @@ mpfr_log10 (mpfr_ptr r, mpfr_srcptr a, mp_rnd_t rnd_mode)
/* estimation of the error */
err = Nt - 4;
- if (MPFR_LIKELY (mpfr_can_round (t, err, GMP_RNDN, GMP_RNDZ,
- Ny + (rnd_mode == GMP_RNDN))))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (t, err, Ny, rnd_mode)))
break;
/* log10(10^n) is exact:
diff --git a/log1p.c b/log1p.c
index fb3d298f6..d3b696a08 100644
--- a/log1p.c
+++ b/log1p.c
@@ -110,8 +110,7 @@ mpfr_log1p (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode)
/*err=Nt-(__gmpfr_ceil_log2(1+pow(2,1-MPFR_GET_EXP(t))));*/
err = Nt - (MAX (1 - MPFR_GET_EXP (t), 0) + 1);
- if (MPFR_LIKELY (mpfr_can_round (t, err, GMP_RNDN, GMP_RNDZ,
- Ny + (rnd_mode == GMP_RNDN))))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (t, err, Ny, rnd_mode)))
break;
/* actualisation of the precision */
diff --git a/log2.c b/log2.c
index 173acd92f..ab9ec7618 100644
--- a/log2.c
+++ b/log2.c
@@ -116,8 +116,7 @@ mpfr_log2 (mpfr_ptr r, mpfr_srcptr a, mp_rnd_t rnd_mode)
/* estimation of the error */
err = Nt-3;
- if (MPFR_LIKELY (mpfr_can_round (t, err, GMP_RNDN, GMP_RNDZ,
- Ny + (rnd_mode == GMP_RNDN))))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (t, err, Ny, rnd_mode)))
break;
/* actualisation of the precision */
diff --git a/mul.c b/mul.c
index 70830b5b1..fbe64575b 100644
--- a/mul.c
+++ b/mul.c
@@ -198,8 +198,6 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode)
/****** END OF CHECK *******/
-
-
/* Multiply 2 mpfr_t */
int
@@ -394,8 +392,8 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode)
mpn_lshift (tmp, tmp, tn, 1);
MPFR_ASSERTD (MPFR_LIMB_MSB (tmp[tn-1]) != 0);
- if (MPFR_UNLIKELY (!mpfr_can_round_raw (tmp, tn, sign, p + b1 - 1,
- GMP_RNDN, GMP_RNDZ, MPFR_PREC(a)+(rnd_mode==GMP_RNDN))))
+ if (MPFR_UNLIKELY (!mpfr_round_p (tmp, tn, p+b1-1,
+ MPFR_PREC(a)+(rnd_mode==GMP_RNDN))))
{
tmp -= k-tn; /* tmp may have changed, FIX IT!!!!! */
goto full_multiply;
diff --git a/pow.c b/pow.c
index 8db9b6bec..db9d52034 100644
--- a/pow.c
+++ b/pow.c
@@ -378,8 +378,7 @@ mpfr_pow (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mp_rnd_t rnd_mode)
/* estimate of the error -- see pow function in algorithms.ps */
err = Nt - (exp_te + 3);
- if (MPFR_LIKELY (mpfr_can_round (t, err, GMP_RNDN, GMP_RNDZ,
- Nz + (rnd_mode == GMP_RNDN))))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (t, err, Nz, rnd_mode)))
break;
/* check exact power */
diff --git a/pow_si.c b/pow_si.c
index fc4cd3f26..19441adbf 100644
--- a/pow_si.c
+++ b/pow_si.c
@@ -120,8 +120,7 @@ mpfr_pow_si (mpfr_ptr y, mpfr_srcptr x, long int n, mp_rnd_t rnd_mode)
/* error estimate -- see pow function in algorithms.ps */
err = Nt - 3;
if (MPFR_LIKELY (inexact != 0
- || mpfr_can_round (t, err, GMP_RNDN, GMP_RNDZ,
- Ny + (rnd_mode == GMP_RNDN))))
+ || MPFR_CAN_ROUND (t, err, Ny, rnd_mode)))
break;
/* actualisation of the precision */
diff --git a/pow_ui.c b/pow_ui.c
index 097968c83..0f0ada445 100644
--- a/pow_ui.c
+++ b/pow_ui.c
@@ -115,8 +115,7 @@ mpfr_pow_ui (mpfr_ptr x, mpfr_srcptr y, unsigned long int n, mp_rnd_t rnd)
}
if (MPFR_LIKELY (inexact == 0
|| mpfr_overflow_p () || mpfr_underflow_p ()
- || mpfr_can_round (res, err, GMP_RNDN, GMP_RNDZ,
- MPFR_PREC(x) + (rnd == GMP_RNDN))))
+ || MPFR_CAN_ROUND (res, err, MPFR_PREC (x), rnd)))
break;
/* Actualisation of the precision */
MPFR_ZIV_NEXT (loop, prec);
diff --git a/pow_z.c b/pow_z.c
index 14c0be8cf..b2cede79e 100644
--- a/pow_z.c
+++ b/pow_z.c
@@ -68,8 +68,7 @@ mpfr_pow_pos_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mp_rnd_t rnd)
if (MPFR_LIKELY (inexact == 0
|| mpfr_overflow_p () || mpfr_underflow_p ()
- || mpfr_can_round (res, err, GMP_RNDN, GMP_RNDZ,
- MPFR_PREC (y) + (rnd == GMP_RNDN))))
+ || MPFR_CAN_ROUND (res, err, MPFR_PREC (y), rnd)))
break;
/* Actualisation of the precision */
@@ -219,8 +218,7 @@ mpfr_pow_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mp_rnd_t rnd)
inexact = inexact || MPFR_IS_ZERO (t) || MPFR_IS_INF (t);
if (MPFR_LIKELY (inexact != 0
- || mpfr_can_round (t, Nt - 3, GMP_RNDN, GMP_RNDZ,
- MPFR_PREC (y) + (rnd == GMP_RNDN))))
+ || MPFR_CAN_ROUND (t, Nt-3, MPFR_PREC (y), rnd)))
break;
/* actualisation of the precision */
MPFR_ZIV_NEXT (loop, Nt);
diff --git a/sinh.c b/sinh.c
index 08211f3cc..decee31f3 100644
--- a/sinh.c
+++ b/sinh.c
@@ -105,8 +105,7 @@ mpfr_sinh (mpfr_ptr y, mpfr_srcptr xt, mp_rnd_t rnd_mode)
/* err = Nt-(__gmpfr_ceil_log2(1+pow(2,d)));*/
err = Nt - (MAX (d, 0) + 1);
- if (mpfr_can_round (t, err, GMP_RNDN, GMP_RNDZ,
- MPFR_PREC (y) + (rnd_mode == GMP_RNDN)))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (t, err, MPFR_PREC (y), rnd_mode)))
break;
}
/* actualisation of the precision */
diff --git a/tan.c b/tan.c
index 6296ecfd9..5b7411dbb 100644
--- a/tan.c
+++ b/tan.c
@@ -72,8 +72,7 @@ mpfr_tan (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode)
mpfr_sin_cos (s, c, x, GMP_RNDN); /* err <= 1/2 ulp on s and c */
mpfr_div (c, s, c, GMP_RNDN); /* err <= 2 ulps */
MPFR_ASSERTD (!MPFR_IS_SINGULAR (c));
- if (MPFR_LIKELY (mpfr_can_round (c, m - 1, GMP_RNDN, GMP_RNDZ,
- precy + (rnd_mode == GMP_RNDN))))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (c, m-1, precy, rnd_mode)))
break;
MPFR_ZIV_NEXT (loop, m);
mpfr_set_prec (s, m);
diff --git a/tanh.c b/tanh.c
index 4585d00bf..eed2c6d0f 100644
--- a/tanh.c
+++ b/tanh.c
@@ -96,8 +96,7 @@ mpfr_tanh (mpfr_ptr y, mpfr_srcptr xt , mp_rnd_t rnd_mode)
d = d - MPFR_GET_EXP (t);
err = Nt - (MAX(d + 1, 3) + 1);
- if (MPFR_LIKELY (mpfr_can_round (t, err, GMP_RNDN, GMP_RNDZ,
- Ny + (rnd_mode == GMP_RNDN))))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (t, err, Ny, rnd_mode)))
break;
/* if t=1, we still can round */
diff --git a/ui_pow_ui.c b/ui_pow_ui.c
index 1303a1884..678801580 100644
--- a/ui_pow_ui.c
+++ b/ui_pow_ui.c
@@ -70,8 +70,7 @@ mpfr_ui_pow_ui (mpfr_ptr x, unsigned long int y, unsigned long int n,
err = prec - err;
if (MPFR_LIKELY (inexact == 0
- || mpfr_can_round (res, err, GMP_RNDN, GMP_RNDZ,
- MPFR_PREC(x) + (rnd == GMP_RNDN))))
+ || MPFR_CAN_ROUND (res, err, MPFR_PREC (x), rnd)))
break;
/* Actualisation of the precision */
diff --git a/zeta.c b/zeta.c
index 96605313d..c8a98ca4e 100644
--- a/zeta.c
+++ b/zeta.c
@@ -174,7 +174,7 @@ mpfr_zeta_pos (mpfr_t z, mpfr_srcptr s, mp_rnd_t rnd_mode)
for (;;)
{
/* Principal loop: we compute, in z_pre,
- an approximation of Zeta(s), that we send to mpfr_can_round */
+ an approximation of Zeta(s), that we send to can_round */
mpfr_sub_ui (s1, s, 1, GMP_RNDN);
MPFR_ASSERTN (MPFR_IS_FP (s1));
@@ -265,8 +265,7 @@ mpfr_zeta_pos (mpfr_t z, mpfr_srcptr s, mp_rnd_t rnd_mode)
}
MPFR_TRACE (MPFR_DUMP (z_pre));
- if (MPFR_LIKELY (mpfr_can_round (z_pre, d - 3, GMP_RNDN, GMP_RNDZ,
- precz + (rnd_mode == GMP_RNDN))))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (z_pre, d-3, precz, rnd_mode)))
break;
MPFR_ZIV_NEXT (loop, d);
}
@@ -389,9 +388,8 @@ mpfr_zeta (mpfr_t z, mpfr_srcptr s, mp_rnd_t rnd_mode)
mpfr_mul (z_pre, z_pre, y, GMP_RNDN);
mpfr_mul_2ui (z_pre, z_pre, 1, GMP_RNDN);
- if (MPFR_LIKELY (mpfr_can_round (z_pre, prec1 - add, GMP_RNDN,
- GMP_RNDZ,
- precz + (rnd_mode == GMP_RNDN))))
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (z_pre, prec1 - add, precz,
+ rnd_mode)))
break;
/* Actualisation of the precision */