diff options
-rw-r--r-- | src/atan.c | 2 | ||||
-rw-r--r-- | src/bernoulli.c | 4 | ||||
-rw-r--r-- | src/const_euler.c | 4 | ||||
-rw-r--r-- | src/digamma.c | 6 | ||||
-rw-r--r-- | src/log_ui.c | 2 | ||||
-rw-r--r-- | src/sin_cos.c | 8 | ||||
-rw-r--r-- | src/zeta.c | 4 | ||||
-rw-r--r-- | tests/tacos.c | 2 | ||||
-rw-r--r-- | tests/tacosh.c | 2 | ||||
-rw-r--r-- | tests/tadd.c | 10 | ||||
-rw-r--r-- | tests/tadd1sp.c | 6 | ||||
-rw-r--r-- | tests/tasin.c | 4 | ||||
-rw-r--r-- | tests/tatan.c | 4 | ||||
-rw-r--r-- | tests/tcmp2.c | 2 | ||||
-rw-r--r-- | tests/tcmp_ui.c | 2 | ||||
-rw-r--r-- | tests/tconst_catalan.c | 2 | ||||
-rw-r--r-- | tests/tdiv.c | 8 | ||||
-rw-r--r-- | tests/texceptions.c | 18 | ||||
-rw-r--r-- | tests/tfits.c | 4 | ||||
-rw-r--r-- | tests/tgamma.c | 4 | ||||
-rw-r--r-- | tests/tget_d.c | 4 | ||||
-rw-r--r-- | tests/tget_d_2exp.c | 2 | ||||
-rw-r--r-- | tests/tget_f.c | 6 | ||||
-rw-r--r-- | tests/tget_flt.c | 6 | ||||
-rw-r--r-- | tests/tget_ld_2exp.c | 4 | ||||
-rw-r--r-- | tests/tget_set_d64.c | 2 | ||||
-rw-r--r-- | tests/tget_str.c | 8 | ||||
-rw-r--r-- | tests/tget_z.c | 4 | ||||
-rw-r--r-- | tests/tmul.c | 4 | ||||
-rw-r--r-- | tests/tpow.c | 4 | ||||
-rw-r--r-- | tests/tremquo.c | 2 | ||||
-rw-r--r-- | tests/trint.c | 2 | ||||
-rw-r--r-- | tests/tset_float128.c | 4 | ||||
-rw-r--r-- | tests/tsqr.c | 12 | ||||
-rw-r--r-- | tests/tsqrt.c | 10 | ||||
-rw-r--r-- | tests/tsub.c | 10 | ||||
-rw-r--r-- | tests/tsub1sp.c | 24 |
37 files changed, 103 insertions, 103 deletions
diff --git a/src/atan.c b/src/atan.c index 310e4d464..1f7659254 100644 --- a/src/atan.c +++ b/src/atan.c @@ -486,7 +486,7 @@ mpfr_atan (mpfr_ptr atan, mpfr_srcptr x, mpfr_rnd_t rnd_mode) mpfr_add (arctgt, arctgt, sk, MPFR_RNDN); /* argument reduction */ - mpfr_mul_2exp (arctgt, arctgt, red, MPFR_RNDN); + mpfr_mul_2ui (arctgt, arctgt, red, MPFR_RNDN); if (comparison > 0) { /* atan(x) = Pi/2-atan(1/x) for x > 0 */ diff --git a/src/bernoulli.c b/src/bernoulli.c index 234e8459d..de4cdf001 100644 --- a/src/bernoulli.c +++ b/src/bernoulli.c @@ -139,13 +139,13 @@ mpfr_bernoulli_internal (mpz_t *b, unsigned long n) Since z <= 2^prec * zeta(n) * 2*den*n!, ulp(z) <= 2*zeta(n) * 2*den*n!, thus (2^prec * zeta(n)-(p+1)) * 2*den*n! < z <= 2^prec * zeta(n) * 2*den*n! */ - mpfr_div_2exp (z, z, prec, MPFR_RNDZ); + mpfr_div_2ui (z, z, prec, MPFR_RNDZ); /* now (zeta(n) - (p+1)/2^prec) * 2*den*n! < z <= zeta(n) * 2*den*n! */ /* divide by (2pi)^n */ mpfr_init2 (y, prec); mpfr_const_pi (y, MPFR_RNDU); /* pi <= y <= pi * (1 + 2^(1-prec)) */ - mpfr_mul_2exp (y, y, 1, MPFR_RNDU); + mpfr_mul_2ui (y, y, 1, MPFR_RNDU); /* 2pi <= y <= 2pi * (1 + 2^(1-prec)) */ mpfr_pow_ui (y, y, n, MPFR_RNDU); /* (2pi)^n <= y <= (2pi)^n * (1 + 2^(1-prec))^(n+1) */ diff --git a/src/const_euler.c b/src/const_euler.c index 2a9dc69e1..032bd7a89 100644 --- a/src/const_euler.c +++ b/src/const_euler.c @@ -251,9 +251,9 @@ mpfr_const_euler_internal (mpfr_t x, mpfr_rnd_t rnd) mpfr_set_ui (y, n, MPFR_RNDZ); /* exact */ mpfr_log (y, y, MPFR_RNDZ); /* error < 2^-wp */ - mpfr_mul_2exp (y, y, wp, MPFR_RNDZ); + mpfr_mul_2ui (y, y, wp, MPFR_RNDZ); mpfr_z_sub (y, v, y, MPFR_RNDZ); - mpfr_div_2exp (y, y, wp, MPFR_RNDZ); + mpfr_div_2ui (y, y, wp, MPFR_RNDZ); /* rounding error from the last subtraction < 2^-wp */ /* so y = gamma with error < 5*2^-wp */ diff --git a/src/digamma.c b/src/digamma.c index 001b47e3f..2613724fa 100644 --- a/src/digamma.c +++ b/src/digamma.c @@ -44,7 +44,7 @@ mpfr_digamma_approx (mpfr_ptr s, mpfr_srcptr x) mpfr_log (s, x, MPFR_RNDN); /* error <= 1/2 ulp */ mpfr_ui_div (t, 1, x, MPFR_RNDN); /* error <= 1/2 ulp */ - mpfr_div_2exp (t, t, 1, MPFR_RNDN); /* exact */ + mpfr_div_2ui (t, t, 1, MPFR_RNDN); /* exact */ mpfr_sub (s, s, t, MPFR_RNDN); /* error <= 1/2 + 1/2*2^(EXP(olds)-EXP(s)) + 1/2*2^(EXP(t)-EXP(s)). For x >= 2, log(x) >= 2*(1/(2x)), thus olds >= 2t, and olds - t >= olds/2, @@ -136,9 +136,9 @@ mpfr_digamma_reflection (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) MPFR_ASSERTN(inex == 0); /* if x is half an integer, cot(Pi*x) = 0, thus Digamma(x) = Digamma(1-x) */ - mpfr_mul_2exp (u, u, 1, MPFR_RNDN); + mpfr_mul_2ui (u, u, 1, MPFR_RNDN); inex = mpfr_integer_p (u); - mpfr_div_2exp (u, u, 1, MPFR_RNDN); + mpfr_div_2ui (u, u, 1, MPFR_RNDN); if (inex) { inex = mpfr_digamma (y, u, rnd_mode); diff --git a/src/log_ui.c b/src/log_ui.c index 6631024ee..2e64fe9df 100644 --- a/src/log_ui.c +++ b/src/log_ui.c @@ -193,7 +193,7 @@ mpfr_log_ui (mpfr_ptr x, unsigned long n, mpfr_rnd_t rnd_mode) mpfr_set_z (t, T[0], MPFR_RNDN); /* t = P[0] * (1 + theta_1) */ mpfr_set_z (q, B[0], MPFR_RNDN); /* q = B[0] * (1 + theta_2) */ - mpfr_mul_2exp (q, q, q0, MPFR_RNDN); /* B[0]*Q[0] */ + mpfr_mul_2ui (q, q, q0, MPFR_RNDN); /* B[0]*Q[0] */ mpfr_div (t, t, q, MPFR_RNDN); /* t = T[0]/(B[0]*Q[0])*(1 + theta_3)^3 = log(n/2^k) * (1 + theta_4)^4 for |theta_i| < 2^(-w) */ diff --git a/src/sin_cos.c b/src/sin_cos.c index 21f521793..8ffdd3c6b 100644 --- a/src/sin_cos.c +++ b/src/sin_cos.c @@ -502,7 +502,7 @@ sincos_aux (mpfr_t s, mpfr_t c, mpfr_srcptr x, mpfr_rnd_t rnd_mode) else { /* y <- trunc(x2 * 2^sh) = trunc(x * 2^(2*sh-1)) */ - mpfr_mul_2exp (x2, x2, sh, MPFR_RNDN); /* exact */ + mpfr_mul_2ui (x2, x2, sh, MPFR_RNDN); /* exact */ mpfr_get_z (y, x2, MPFR_RNDZ); /* round toward zero: now 0 <= x2 < 2^sh, thus 0 <= x2/2^(sh-1) < 2^(1-sh) */ @@ -548,11 +548,11 @@ sincos_aux (mpfr_t s, mpfr_t c, mpfr_srcptr x, mpfr_rnd_t rnd_mode) mpfr_set_z (s, S, MPFR_RNDN); mpfr_div_z (s, s, Q, MPFR_RNDN); - mpfr_div_2exp (s, s, l, MPFR_RNDN); + mpfr_div_2ui (s, s, l, MPFR_RNDN); mpfr_set_z (c, C, MPFR_RNDN); mpfr_div_z (c, c, Q, MPFR_RNDN); - mpfr_div_2exp (c, c, l, MPFR_RNDN); + mpfr_div_2ui (c, c, l, MPFR_RNDN); mpz_clear (Q); mpz_clear (S); @@ -615,7 +615,7 @@ mpfr_sincos_fast (mpfr_t s, mpfr_t c, mpfr_srcptr x, mpfr_rnd_t rnd) mpfr_init2 (x_red, w); mpfr_init2 (pi, (MPFR_EXP(x) > 0) ? w + MPFR_EXP(x) : w); mpfr_const_pi (pi, MPFR_RNDN); - mpfr_div_2exp (pi, pi, 1, MPFR_RNDN); /* Pi/2 */ + mpfr_div_2ui (pi, pi, 1, MPFR_RNDN); /* Pi/2 */ mpfr_remquo (x_red, &q, x, pi, MPFR_RNDN); /* x = q * (Pi/2 + eps1) + x_red + eps2, where |eps1| <= 1/2*ulp(Pi/2) = 2^(-w-MAX(0,EXP(x))), diff --git a/src/zeta.c b/src/zeta.c index a0b996b10..d1972bad0 100644 --- a/src/zeta.c +++ b/src/zeta.c @@ -323,7 +323,7 @@ compute_add (mpfr_srcptr s, mpfr_prec_t precz) /* since 1/eps = 2^(precz+14), if EXP(sd) >= precz+14, then sd >= 1/2*2^(precz+14) thus 2*sd >= 2^(precz+14) >= 1/eps */ if (mpfr_get_exp (t) >= precz + 14) - mpfr_mul_2exp (t, t, 1, MPFR_RNDU); + mpfr_mul_2ui (t, t, 1, MPFR_RNDU); else mpfr_set_ui_2exp (t, 1, precz + 14, MPFR_RNDU); /* now t = max(1/eps,2*sd) */ @@ -335,7 +335,7 @@ compute_add (mpfr_srcptr s, mpfr_prec_t precz) else mpfr_set (t, m1, MPFR_RNDU); /* now t = max(8,m1) */ - mpfr_div_2exp (t, t, precz + 14, MPFR_RNDU); /* eps*max(8,m1) */ + mpfr_div_2ui (t, t, precz + 14, MPFR_RNDU); /* eps*max(8,m1) */ mpfr_add_ui (t, t, 1, MPFR_RNDU); /* 1+eps*max(8,m1) */ mpfr_mul (t, t, u, MPFR_RNDU); /* t = c */ mpfr_add_ui (u, m1, 13, MPFR_RNDU); /* 13+m1 */ diff --git a/tests/tacos.c b/tests/tacos.c index a91f9b680..c7fcfe3d3 100644 --- a/tests/tacos.c +++ b/tests/tacos.c @@ -148,7 +148,7 @@ main (void) mpfr_set_ui (x, 0, MPFR_RNDN); /* exact */ mpfr_acos (y, x, (mpfr_rnd_t) r); mpfr_const_pi (x, (mpfr_rnd_t) r); - mpfr_div_2exp (x, x, 1, MPFR_RNDN); /* exact */ + mpfr_div_2ui (x, x, 1, MPFR_RNDN); /* exact */ if (mpfr_cmp (x, y)) { printf ("Error: acos(0) != Pi/2 for rnd=%s\n", diff --git a/tests/tacosh.c b/tests/tacosh.c index 00082fba0..7d628b2a3 100644 --- a/tests/tacosh.c +++ b/tests/tacosh.c @@ -105,7 +105,7 @@ special (void) } mpfr_set_ui (x, 1, MPFR_RNDN); - mpfr_div_2exp (x, x, 1, MPFR_RNDN); + mpfr_div_2ui (x, x, 1, MPFR_RNDN); mpfr_acosh (y, x, MPFR_RNDN); if (!mpfr_nan_p (y)) { diff --git a/tests/tadd.c b/tests/tadd.c index d1db06ea5..f65fd3c46 100644 --- a/tests/tadd.c +++ b/tests/tadd.c @@ -375,18 +375,18 @@ check_case_1b (void) mpfr_set_prec (b, prec_b); /* b = 1 - 2^(-prec_a) + 2^(-prec_b) */ mpfr_set_ui (b, 1, MPFR_RNDN); - mpfr_div_2exp (b, b, dif, MPFR_RNDN); + mpfr_div_2ui (b, b, dif, MPFR_RNDN); mpfr_sub_ui (b, b, 1, MPFR_RNDN); - mpfr_div_2exp (b, b, prec_a, MPFR_RNDN); + mpfr_div_2ui (b, b, prec_a, MPFR_RNDN); mpfr_add_ui (b, b, 1, MPFR_RNDN); for (prec_c = dif; prec_c <= 64; prec_c++) { /* c = 2^(-prec_a) - 2^(-prec_b) */ mpfr_set_prec (c, prec_c); mpfr_set_si (c, -1, MPFR_RNDN); - mpfr_div_2exp (c, c, dif, MPFR_RNDN); + mpfr_div_2ui (c, c, dif, MPFR_RNDN); mpfr_add_ui (c, c, 1, MPFR_RNDN); - mpfr_div_2exp (c, c, prec_a, MPFR_RNDN); + mpfr_div_2ui (c, c, prec_a, MPFR_RNDN); test_add (a, b, c, MPFR_RNDN); if (mpfr_cmp_ui (a, 1) != 0) { @@ -1267,7 +1267,7 @@ test_rndf_exact (mp_size_t pmax) for (eb = 0; eb <= pmax + 3; eb ++) { mpfr_urandomb (b, RANDS); - mpfr_mul_2exp (b, b, eb, MPFR_RNDN); + mpfr_mul_2ui (b, b, eb, MPFR_RNDN); for (pc = MPFR_PREC_MIN; pc <= pmax; pc++) { if ((pc + 2) % GMP_NUMB_BITS > 4) diff --git a/tests/tadd1sp.c b/tests/tadd1sp.c index 0f712c92d..f40b7136c 100644 --- a/tests/tadd1sp.c +++ b/tests/tadd1sp.c @@ -174,9 +174,9 @@ coverage (void) mpfr_set_prec (c, 2 * GMP_NUMB_BITS + 1); mpfr_set_ui_2exp (b, 1, mpfr_get_emax () - 1, MPFR_RNDN); mpfr_nextbelow (b); - mpfr_mul_2exp (b, b, 1, MPFR_RNDN); + mpfr_mul_2ui (b, b, 1, MPFR_RNDN); /* now b is the largest number < +Inf */ - mpfr_div_2exp (c, b, GMP_NUMB_BITS - 1, MPFR_RNDN); + mpfr_div_2ui (c, b, GMP_NUMB_BITS - 1, MPFR_RNDN); /* we are in the case d < GMP_NUMB_BITS of mpfr_add1sp3 */ inex = mpfr_add (a, b, b, MPFR_RNDU); MPFR_ASSERTN(inex > 0); @@ -205,7 +205,7 @@ coverage (void) mpfr_set_prec (c, 2 * GMP_NUMB_BITS + 1); mpfr_set_ui_2exp (b, 1, mpfr_get_emax () - 1, MPFR_RNDN); mpfr_nextbelow (b); - mpfr_mul_2exp (b, b, 1, MPFR_RNDN); + mpfr_mul_2ui (b, b, 1, MPFR_RNDN); /* now b is the largest number < +Inf */ mpfr_set_ui_2exp (c, 1, mpfr_get_emin () - 1, MPFR_RNDN); inex = mpfr_add (a, b, c, MPFR_RNDU); diff --git a/tests/tasin.c b/tests/tasin.c index bcc4ebe2d..8933270e5 100644 --- a/tests/tasin.c +++ b/tests/tasin.c @@ -98,7 +98,7 @@ special (void) mpfr_set_ui (x, 1, MPFR_RNDN); /* exact */ mpfr_asin (y, x, (mpfr_rnd_t) r); mpfr_const_pi (x, (mpfr_rnd_t) r); - mpfr_div_2exp (x, x, 1, MPFR_RNDN); /* exact */ + mpfr_div_2ui (x, x, 1, MPFR_RNDN); /* exact */ if (mpfr_cmp (x, y)) { printf ("Error: asin(1) != Pi/2 for rnd=%s\n", @@ -114,7 +114,7 @@ special (void) mpfr_asin (y, x, (mpfr_rnd_t) r); mpfr_const_pi (x, MPFR_INVERT_RND((mpfr_rnd_t) r)); mpfr_neg (x, x, MPFR_RNDN); /* exact */ - mpfr_div_2exp (x, x, 1, MPFR_RNDN); /* exact */ + mpfr_div_2ui (x, x, 1, MPFR_RNDN); /* exact */ if (mpfr_cmp (x, y)) { printf ("Error: asin(-1) != -Pi/2 for rnd=%s\n", diff --git a/tests/tatan.c b/tests/tatan.c index cfaf16ad3..4dd3dc5cb 100644 --- a/tests/tatan.c +++ b/tests/tatan.c @@ -55,7 +55,7 @@ special (void) mpfr_set_inf (x, 1); mpfr_atan (y, x, (mpfr_rnd_t) r); mpfr_const_pi (x, (mpfr_rnd_t) r); - mpfr_div_2exp (x, x, 1, (mpfr_rnd_t) r); + mpfr_div_2ui (x, x, 1, (mpfr_rnd_t) r); if (mpfr_cmp (x, y)) { printf ("Error: mpfr_atan(+Inf), rnd=%s\n", @@ -71,7 +71,7 @@ special (void) mpfr_atan (y, x, (mpfr_rnd_t) r); mpfr_const_pi (x, MPFR_INVERT_RND((mpfr_rnd_t) r)); mpfr_neg (x, x, (mpfr_rnd_t) r); - mpfr_div_2exp (x, x, 1, (mpfr_rnd_t) r); + mpfr_div_2ui (x, x, 1, (mpfr_rnd_t) r); if (mpfr_cmp (x, y)) { printf ("Error: mpfr_atan(-Inf), rnd=%s\n", diff --git a/tests/tcmp2.c b/tests/tcmp2.c index 5dfe560b3..0267ecfbb 100644 --- a/tests/tcmp2.c +++ b/tests/tcmp2.c @@ -57,7 +57,7 @@ worst_cases (void) for (i = 1; i < MPFR_PREC(x); i++) { mpfr_set_ui (x, 1, MPFR_RNDN); - mpfr_div_2exp (y, y, 1, MPFR_RNDN); /* y = 1/2^i */ + mpfr_div_2ui (y, y, 1, MPFR_RNDN); /* y = 1/2^i */ l = 0; if (mpfr_cmp2 (x, y, &l) <= 0 || l != 1) diff --git a/tests/tcmp_ui.c b/tests/tcmp_ui.c index 20397079d..806bd0b09 100644 --- a/tests/tcmp_ui.c +++ b/tests/tcmp_ui.c @@ -326,7 +326,7 @@ main (void) /* corner case */ mpfr_set_ui (x, 1, MPFR_RNDZ); - mpfr_mul_2exp (x, x, GMP_NUMB_BITS - 1, MPFR_RNDZ); + mpfr_mul_2ui (x, x, GMP_NUMB_BITS - 1, MPFR_RNDZ); /* now EXP(x)=GMP_NUMB_BITS */ MPFR_ASSERTN(mpfr_cmp_si (x, 1) > 0); diff --git a/tests/tconst_catalan.c b/tests/tconst_catalan.c index e13f72ec5..570b50a6b 100644 --- a/tests/tconst_catalan.c +++ b/tests/tconst_catalan.c @@ -42,7 +42,7 @@ main (int argc, char *argv[]) mpfr_init2 (x, 32); (mpfr_const_catalan) (x, MPFR_RNDN); - mpfr_mul_2exp (x, x, 32, MPFR_RNDN); + mpfr_mul_2ui (x, x, 32, MPFR_RNDN); if (mpfr_cmp_ui (x, 3934042271UL)) { printf ("Error in const_catalan for prec=32\n"); diff --git a/tests/tdiv.c b/tests/tdiv.c index 2b328c5f3..7d379f967 100644 --- a/tests/tdiv.c +++ b/tests/tdiv.c @@ -913,7 +913,7 @@ check_special (void) set_emax (1); mpfr_set_ui (a, 1, MPFR_RNDZ); mpfr_set_ui (d, 1, MPFR_RNDZ); - mpfr_div_2exp (d, d, 1, MPFR_RNDZ); + mpfr_div_2ui (d, d, 1, MPFR_RNDZ); mpfr_clear_flags (); test_div (q, a, d, MPFR_RNDU); /* 1 / 0.5 = 2 -> overflow */ MPFR_ASSERTN (mpfr_inf_p (q) && mpfr_sgn (q) > 0); @@ -924,7 +924,7 @@ check_special (void) emin = mpfr_get_emin (); set_emin (-1); mpfr_set_ui (a, 1, MPFR_RNDZ); - mpfr_div_2exp (a, a, 2, MPFR_RNDZ); + mpfr_div_2ui (a, a, 2, MPFR_RNDZ); mpfr_set_prec (d, mpfr_get_prec (q) + 8); for (i = -1; i <= 1; i++) { @@ -1376,7 +1376,7 @@ test_mpfr_divsp2 (void) mpfr_set_str (v, "241810647971575979588130185988987264768", 10, MPFR_RNDN); mpfr_div (q, u, v, MPFR_RNDN); mpfr_set_str (u, "5732952910203749289426944", 10, MPFR_RNDN); - mpfr_div_2exp (u, u, 82, MPFR_RNDN); + mpfr_div_2ui (u, u, 82, MPFR_RNDN); MPFR_ASSERTN(mpfr_equal_p (q, u)); mpfr_clear (u); @@ -1405,7 +1405,7 @@ test_20160831 (void) mpfr_set_str (v, "205987256581218236405412302590110119580", 10, MPFR_RNDN); mpfr_div (q, u, v, MPFR_RNDN); mpfr_set_str (u, "19217137613667309953639458782352244736", 10, MPFR_RNDN); - mpfr_div_2exp (u, u, 124, MPFR_RNDN); + mpfr_div_2ui (u, u, 124, MPFR_RNDN); MPFR_ASSERTN (mpfr_equal_p (q, u)); mpfr_clears (u, v, q, (mpfr_ptr) 0); diff --git a/tests/texceptions.c b/tests/texceptions.c index caec8dc05..69373d72b 100644 --- a/tests/texceptions.c +++ b/tests/texceptions.c @@ -152,13 +152,13 @@ check_flags (void) mpfr_set_ui (x, 1, MPFR_RNDN); (mpfr_clear_overflow)(); - mpfr_mul_2exp (x, x, 1024, MPFR_RNDN); + mpfr_mul_2ui (x, x, 1024, MPFR_RNDN); if (!(mpfr_overflow_p)()) PRINT_ERROR ("ERROR: No overflow detected!\n"); (mpfr_clear_underflow)(); mpfr_set_ui (x, 1, MPFR_RNDN); - mpfr_div_2exp (x, x, 1025, MPFR_RNDN); + mpfr_div_2ui (x, x, 1025, MPFR_RNDN); if (!(mpfr_underflow_p)()) PRINT_ERROR ("ERROR: No underflow detected!\n"); @@ -176,7 +176,7 @@ check_flags (void) (mpfr_clear_erangeflag) (); mpfr_set_ui (x, 1, MPFR_RNDN); - mpfr_mul_2exp (x, x, 1024, MPFR_RNDN); + mpfr_mul_2ui (x, x, 1024, MPFR_RNDN); mpfr_get_ui (x, MPFR_RNDN); if (!(mpfr_erangeflag_p)()) PRINT_ERROR ("ERROR: No erange flag!\n"); @@ -473,7 +473,7 @@ main (int argc, char *argv[]) } mpfr_set_ui (x, 1, MPFR_RNDN); - mpfr_mul_2exp (x, x, 1024, MPFR_RNDN); + mpfr_mul_2ui (x, x, 1024, MPFR_RNDN); mpfr_set_double_range (); mpfr_check_range (x, 0, MPFR_RNDN); if (!mpfr_inf_p (x) || (mpfr_sgn(x) <= 0)) @@ -484,7 +484,7 @@ main (int argc, char *argv[]) set_emax (1025); mpfr_set_ui (x, 1, MPFR_RNDN); - mpfr_mul_2exp (x, x, 1024, MPFR_RNDN); + mpfr_mul_2ui (x, x, 1024, MPFR_RNDN); mpfr_set_double_range (); mpfr_check_range (x, 0, MPFR_RNDD); if (!mpfr_number_p (x)) @@ -494,7 +494,7 @@ main (int argc, char *argv[]) } mpfr_set_ui (x, 1, MPFR_RNDN); - mpfr_mul_2exp (x, x, 1023, MPFR_RNDN); + mpfr_mul_2ui (x, x, 1023, MPFR_RNDN); mpfr_add (x, x, x, MPFR_RNDN); if (!mpfr_inf_p (x) || (mpfr_sgn(x) <= 0)) { @@ -505,7 +505,7 @@ main (int argc, char *argv[]) } mpfr_set_ui (x, 1, MPFR_RNDN); - mpfr_mul_2exp (x, x, 1023, MPFR_RNDN); + mpfr_mul_2ui (x, x, 1023, MPFR_RNDN); mpfr_add (x, x, x, MPFR_RNDD); if (!mpfr_number_p (x)) { @@ -515,7 +515,7 @@ main (int argc, char *argv[]) } mpfr_set_ui (x, 1, MPFR_RNDN); - mpfr_div_2exp (x, x, 1022, MPFR_RNDN); + mpfr_div_2ui (x, x, 1022, MPFR_RNDN); mpfr_set_str_binary (y, "1.1e-1022"); /* y = 3/2*x */ mpfr_sub (y, y, x, MPFR_RNDZ); if (mpfr_cmp_ui (y, 0)) @@ -528,7 +528,7 @@ main (int argc, char *argv[]) set_emin (-1026); mpfr_set_ui (x, 1, MPFR_RNDN); - mpfr_div_2exp (x, x, 1025, MPFR_RNDN); + mpfr_div_2ui (x, x, 1025, MPFR_RNDN); mpfr_set_double_range (); mpfr_check_range (x, 0, MPFR_RNDN); if (!MPFR_IS_ZERO (x) ) diff --git a/tests/tfits.c b/tests/tfits.c index 089281485..0642cad42 100644 --- a/tests/tfits.c +++ b/tests/tfits.c @@ -166,9 +166,9 @@ main (void) /* Check large values (no fit) */ mpfr_set_ui (x, ULONG_MAX, MPFR_RNDN); - mpfr_mul_2exp (x, x, 1, MPFR_RNDN); + mpfr_mul_2ui (x, x, 1, MPFR_RNDN); CHECK_ALL (8, !!); - mpfr_mul_2exp (x, x, 40, MPFR_RNDN); + mpfr_mul_2ui (x, x, 40, MPFR_RNDN); CHECK_ALL (9, !!); /* Check a non-integer number just below a power of two. */ diff --git a/tests/tgamma.c b/tests/tgamma.c index 8e1067b2a..c164e856e 100644 --- a/tests/tgamma.c +++ b/tests/tgamma.c @@ -326,11 +326,11 @@ special_overflow (void) mpfr_set_prec (y, 38); mpfr_set_str (x, "-2993155353253689176481146537402947624254601559176535", 10, MPFR_RNDN); - mpfr_div_2exp (x, x, 170, MPFR_RNDN); + mpfr_div_2ui (x, x, 170, MPFR_RNDN); mpfr_gamma (y, x, MPFR_RNDN); mpfr_set_prec (x, 38); mpfr_set_str (x, "201948391737", 10, MPFR_RNDN); - mpfr_mul_2exp (x, x, 92, MPFR_RNDN); + mpfr_mul_2ui (x, x, 92, MPFR_RNDN); if (mpfr_cmp (x, y)) { printf ("Error for gamma (test 5)\n"); diff --git a/tests/tget_d.c b/tests/tget_d.c index f372797fa..da69280d3 100644 --- a/tests/tget_d.c +++ b/tests/tget_d.c @@ -41,7 +41,7 @@ check_denorms (void) d = (double) k * DBL_MIN; /* k * 2^(-1022) */ f = 1.0; mpfr_set_si (x, k, MPFR_RNDN); - mpfr_div_2exp (x, x, 1022, MPFR_RNDN); /* k * 2^(-1022) */ + mpfr_div_2ui (x, x, 1022, MPFR_RNDN); /* k * 2^(-1022) */ for (n = 0; n <= 58; n++) { d2 = d * f; @@ -54,7 +54,7 @@ check_denorms (void) fail = 1; } f *= 0.5; - mpfr_div_2exp (x, x, 1, MPFR_RNDN); + mpfr_div_2ui (x, x, 1, MPFR_RNDN); } } diff --git a/tests/tget_d_2exp.c b/tests/tget_d_2exp.c index 104d316c7..b5ad497b4 100644 --- a/tests/tget_d_2exp.c +++ b/tests/tget_d_2exp.c @@ -43,7 +43,7 @@ check_round (void) for (i = 0; i < (int) numberof (data); i++) { mpfr_set_ui (f, 1L, MPFR_RNDZ); - mpfr_mul_2exp (f, f, data[i], MPFR_RNDZ); + mpfr_mul_2ui (f, f, data[i], MPFR_RNDZ); mpfr_sub_ui (f, f, 1L, MPFR_RNDZ); for (neg = 0; neg <= 1; neg++) diff --git a/tests/tget_f.c b/tests/tget_f.c index 2face92c2..2a7abbf19 100644 --- a/tests/tget_f.c +++ b/tests/tget_f.c @@ -58,7 +58,7 @@ prec_test (void) int inex; mpf_div_2exp (x2, x2, 1); mpf_add (x1, x1, x2); - mpfr_div_2exp (y2, y2, 1, MPFR_RNDN); + mpfr_div_2ui (y2, y2, 1, MPFR_RNDN); inex = mpfr_add (y1, y1, y2, MPFR_RNDN); MPFR_ASSERTN (inex == 0); mpfr_set_f (y3, x1, MPFR_RNDN); @@ -329,7 +329,7 @@ main (void) { /* test with 2^(-e) */ mpfr_set_ui (y, 1, MPFR_RNDN); - mpfr_div_2exp (y, y, e, MPFR_RNDN); + mpfr_div_2ui (y, y, e, MPFR_RNDN); inex = mpfr_get_f (x, y, MPFR_RNDN); mpf_mul_2exp (x, x, e); if (inex != 0 || mpf_cmp_ui (x, 1) != 0) @@ -345,7 +345,7 @@ main (void) /* test with 2^(e) */ mpfr_set_ui (y, 1, MPFR_RNDN); - mpfr_mul_2exp (y, y, e, MPFR_RNDN); + mpfr_mul_2ui (y, y, e, MPFR_RNDN); inex = mpfr_get_f (x, y, MPFR_RNDN); mpf_div_2exp (x, x, e); if (inex != 0 || mpf_cmp_ui (x, 1) != 0) diff --git a/tests/tget_flt.c b/tests/tget_flt.c index 5be1fe7e1..20f03ef40 100644 --- a/tests/tget_flt.c +++ b/tests/tget_flt.c @@ -169,7 +169,7 @@ main (void) printf ("got "); mpfr_dump (y); exit (1); } - mpfr_mul_2exp (x, x, 1, MPFR_RNDN); + mpfr_mul_2ui (x, x, 1, MPFR_RNDN); } mpfr_set_prec (x, 53); @@ -187,7 +187,7 @@ main (void) printf ("got "); mpfr_dump (y); exit (1); } - mpfr_mul_2exp (x, x, 1, MPFR_RNDN); + mpfr_mul_2ui (x, x, 1, MPFR_RNDN); } mpfr_set_prec (x, 53); @@ -205,7 +205,7 @@ main (void) printf ("got "); mpfr_dump (y); exit (1); } - mpfr_mul_2exp (x, x, 1, MPFR_RNDN); + mpfr_mul_2ui (x, x, 1, MPFR_RNDN); } #ifdef HAVE_DENORMS_FLT diff --git a/tests/tget_ld_2exp.c b/tests/tget_ld_2exp.c index 950861365..26b68cae9 100644 --- a/tests/tget_ld_2exp.c +++ b/tests/tget_ld_2exp.c @@ -42,7 +42,7 @@ check_round (void) for (i = 0; i < (int) numberof (data); i++) { mpfr_set_ui (f, 1L, MPFR_RNDZ); - mpfr_mul_2exp (f, f, data[i], MPFR_RNDZ); + mpfr_mul_2ui (f, f, data[i], MPFR_RNDZ); mpfr_sub_ui (f, f, 1L, MPFR_RNDZ); for (neg = 0; neg <= 1; neg++) @@ -112,7 +112,7 @@ bug20090520 (void) mpfr_init (x); mpfr_set_ui (x, 1, MPFR_RNDN); d = 1.0; - mpfr_div_2exp (x, x, 16383, MPFR_RNDN); + mpfr_div_2ui (x, x, 16383, MPFR_RNDN); for (i = 0; i < 16383; i++) d *= 0.5; e = mpfr_get_ld (x, MPFR_RNDN); diff --git a/tests/tget_set_d64.c b/tests/tget_set_d64.c index a5f149b6b..05191b95a 100644 --- a/tests/tget_set_d64.c +++ b/tests/tget_set_d64.c @@ -298,7 +298,7 @@ check_random (void) /* the normal decimal64 range contains [2^(-1272), 2^1278] */ mpfr_mul_2si (x, x, (i % 2550) - 1272, MPFR_RNDN); if (mpfr_get_exp (x) <= -1272) - mpfr_mul_2exp (x, x, -1271 - mpfr_get_exp (x), MPFR_RNDN); + mpfr_mul_2ui (x, x, -1271 - mpfr_get_exp (x), MPFR_RNDN); d = mpfr_get_decimal64 (x, MPFR_RNDN); mpfr_set_decimal64 (y, d, MPFR_RNDN); if (mpfr_cmp (x, y) != 0) diff --git a/tests/tget_str.c b/tests/tget_str.c index e5efbcd8a..2bec91201 100644 --- a/tests/tget_str.c +++ b/tests/tget_str.c @@ -76,9 +76,9 @@ check_small (void) mpfr_set_prec (x, 64); mpfr_set_si (x, -1, MPFR_RNDN); - mpfr_div_2exp (x, x, 63, MPFR_RNDN); /* x = -2^(-63) */ + mpfr_div_2ui (x, x, 63, MPFR_RNDN); /* x = -2^(-63) */ mpfr_add_ui (x, x, 1, MPFR_RNDN); /* x = 1 - 2^(-63) */ - mpfr_mul_2exp (x, x, 32, MPFR_RNDN); /* x = 2^32 - 2^(-31) */ + mpfr_mul_2ui (x, x, 32, MPFR_RNDN); /* x = 2^32 - 2^(-31) */ s = mpfr_get_str (NULL, &e, 3, 21, x, MPFR_RNDU); if (strcmp (s, "102002022201221111211") || (e != 21)) { @@ -991,7 +991,7 @@ check_large (void) mpfr_init2 (x, 3322); mpfr_set_str (x, xm, 10, MPFR_RNDN); - mpfr_div_2exp (x, x, 4343, MPFR_RNDN); + mpfr_div_2ui (x, x, 4343, MPFR_RNDN); s = mpfr_get_str (NULL, &e, 10, 1000, x, MPFR_RNDN); if (s[999] != '1') /* s must be 5.04383...689071e-309 */ { @@ -1001,7 +1001,7 @@ check_large (void) } mpfr_free_str (s); - mpfr_mul_2exp (x, x, 4343, MPFR_RNDN); + mpfr_mul_2ui (x, x, 4343, MPFR_RNDN); s = mpfr_get_str (NULL, &e, 10, 2, x, MPFR_RNDN); if (strcmp (s, "12") || (e != 1000)) { diff --git a/tests/tget_z.c b/tests/tget_z.c index a4d306f00..3f9ff9223 100644 --- a/tests/tget_z.c +++ b/tests/tget_z.c @@ -92,8 +92,8 @@ check_one (mpz_ptr z) MPFR_ASSERTN (inex == 0); inex = sh < 0 ? - mpfr_div_2exp (f, f, -sh, MPFR_RNDN) : - mpfr_mul_2exp (f, f, sh, MPFR_RNDN); + mpfr_div_2ui (f, f, -sh, MPFR_RNDN) : + mpfr_mul_2ui (f, f, sh, MPFR_RNDN); MPFR_ASSERTN (inex == 0); for (neg = 0; neg <= 1; neg++) diff --git a/tests/tmul.c b/tests/tmul.c index 41300922f..f5d06f80e 100644 --- a/tests/tmul.c +++ b/tests/tmul.c @@ -746,7 +746,7 @@ test_underflow (mpfr_prec_t pmax) printf ("c="); mpfr_dump (c); printf ("a="); mpfr_dump (a); mpfr_set_prec (a, mpfr_get_prec (b) + mpfr_get_prec (c)); - mpfr_mul_2exp (b, b, 1, MPFR_RNDN); + mpfr_mul_2ui (b, b, 1, MPFR_RNDN); inex = mpfr_mul (a, b, c, MPFR_RNDN); MPFR_ASSERTN (inex == 0); printf ("Exact 2*a="); mpfr_dump (a); @@ -789,7 +789,7 @@ test_underflow (mpfr_prec_t pmax) printf ("c="); mpfr_dump (c); printf ("a="); mpfr_dump (a); mpfr_set_prec (a, mpfr_get_prec (b) + mpfr_get_prec (c)); - mpfr_mul_2exp (b, b, 1, MPFR_RNDN); + mpfr_mul_2ui (b, b, 1, MPFR_RNDN); inex = mpfr_mul (a, b, c, MPFR_RNDN); MPFR_ASSERTN (inex == 0); printf ("Exact 2*a="); mpfr_dump (a); diff --git a/tests/tpow.c b/tests/tpow.c index e4f896440..5ce949dbf 100644 --- a/tests/tpow.c +++ b/tests/tpow.c @@ -635,7 +635,7 @@ special (void) mpfr_set_inf (x, -1); mpfr_set_prec (y, 2 * mp_bits_per_limb); mpfr_set_ui (y, 1, MPFR_RNDN); - mpfr_mul_2exp (y, y, mp_bits_per_limb - 1, MPFR_RNDN); + mpfr_mul_2ui (y, y, mp_bits_per_limb - 1, MPFR_RNDN); /* y = 2^(mp_bits_per_limb - 1) */ test_pow (z, x, y, MPFR_RNDN); MPFR_ASSERTN(mpfr_inf_p (z) && MPFR_IS_POS(z)); @@ -644,7 +644,7 @@ special (void) /* y = 2^(mp_bits_per_limb - 1) + epsilon */ MPFR_ASSERTN(mpfr_inf_p (z) && MPFR_IS_POS(z)); mpfr_nextbelow (y); - mpfr_div_2exp (y, y, 1, MPFR_RNDN); + mpfr_div_2ui (y, y, 1, MPFR_RNDN); mpfr_nextabove (y); test_pow (z, x, y, MPFR_RNDN); /* y = 2^(mp_bits_per_limb - 2) + epsilon */ diff --git a/tests/tremquo.c b/tests/tremquo.c index 55eb82564..c159f9094 100644 --- a/tests/tremquo.c +++ b/tests/tremquo.c @@ -320,7 +320,7 @@ main (int argc, char *argv[]) mpfr_set_prec (x, 65); mpfr_set_prec (y, 65); mpfr_const_pi (x, MPFR_RNDN); - mpfr_mul_2exp (x, x, 63, MPFR_RNDN); + mpfr_mul_2ui (x, x, 63, MPFR_RNDN); mpfr_const_log2 (y, MPFR_RNDN); mpfr_set_prec (r, 10); mpfr_remquo (r, q, x, y, MPFR_RNDN); diff --git a/tests/trint.c b/tests/trint.c index 7dfba26e6..86aa7ac00 100644 --- a/tests/trint.c +++ b/tests/trint.c @@ -60,7 +60,7 @@ special (void) /* coverage test */ mpfr_set_prec (x, 2); mpfr_set_ui (x, 1, MPFR_RNDN); - mpfr_mul_2exp (x, x, mp_bits_per_limb, MPFR_RNDN); + mpfr_mul_2ui (x, x, mp_bits_per_limb, MPFR_RNDN); mpfr_rint (y, x, MPFR_RNDN); MPFR_ASSERTN(mpfr_cmp (y, x) == 0); diff --git a/tests/tset_float128.c b/tests/tset_float128.c index 5578d87ed..0f8845f90 100644 --- a/tests/tset_float128.c +++ b/tests/tset_float128.c @@ -160,7 +160,7 @@ check_large (void) f = f + f; f = f - (_Float128) 1.0; mpfr_set_ui (y, 1, MPFR_RNDN); - mpfr_mul_2exp (y, y, 113, MPFR_RNDN); + mpfr_mul_2ui (y, y, 113, MPFR_RNDN); mpfr_sub_ui (y, y, 1, MPFR_RNDN); for (i = 113; i < 16384; i++) { @@ -315,7 +315,7 @@ check_small (void) } } f = 0.5 * f; - mpfr_div_2exp (y, y, 1, MPFR_RNDN); + mpfr_div_2ui (y, y, 1, MPFR_RNDN); } mpfr_clears (w, x, y, z, (mpfr_ptr) 0); diff --git a/tests/tsqr.c b/tests/tsqr.c index 3701c146d..2b1e64756 100644 --- a/tests/tsqr.c +++ b/tests/tsqr.c @@ -206,7 +206,7 @@ coverage (mpfr_prec_t pmax) /* exercise carry in most significant bits of a, with overflow */ mpfr_set_ui_2exp (b, 1, mpfr_get_emax (), MPFR_RNDZ); mpfr_sqrt (b, b, MPFR_RNDU); - mpfr_div_2exp (c, b, 1, MPFR_RNDN); + mpfr_div_2ui (c, b, 1, MPFR_RNDN); mpfr_sqr (c, c, MPFR_RNDN); mpfr_clear_flags (); inex = mpfr_sqr (a, b, MPFR_RNDN); @@ -229,7 +229,7 @@ coverage (mpfr_prec_t pmax) /* same as above, with RNDU */ mpfr_set_ui_2exp (b, 1, mpfr_get_emax (), MPFR_RNDZ); mpfr_sqrt (b, b, MPFR_RNDU); - mpfr_div_2exp (c, b, 1, MPFR_RNDN); + mpfr_div_2ui (c, b, 1, MPFR_RNDN); mpfr_sqr (c, c, MPFR_RNDU); mpfr_clear_flags (); inex = mpfr_sqr (a, b, MPFR_RNDU); @@ -252,7 +252,7 @@ coverage (mpfr_prec_t pmax) /* exercise trivial overflow */ mpfr_set_ui_2exp (b, 1, mpfr_get_emax (), MPFR_RNDZ); mpfr_sqrt (b, b, MPFR_RNDU); - mpfr_mul_2exp (b, b, 1, MPFR_RNDN); + mpfr_mul_2ui (b, b, 1, MPFR_RNDN); mpfr_clear_flags (); inex = mpfr_sqr (a, b, MPFR_RNDN); MPFR_ASSERTN(inex > 0); @@ -262,7 +262,7 @@ coverage (mpfr_prec_t pmax) /* exercise trivial underflow */ mpfr_set_ui_2exp (b, 1, mpfr_get_emin () - 1, MPFR_RNDZ); mpfr_sqrt (b, b, MPFR_RNDU); - mpfr_div_2exp (b, b, 1, MPFR_RNDN); + mpfr_div_2ui (b, b, 1, MPFR_RNDN); mpfr_clear_flags (); inex = mpfr_sqr (a, b, MPFR_RNDN); MPFR_ASSERTN(inex < 0); @@ -275,7 +275,7 @@ coverage (mpfr_prec_t pmax) mpfr_set_ui_2exp (b, 1, mpfr_get_emin () - 1, MPFR_RNDN); inex = mpfr_sqrt (b, b, MPFR_RNDZ); MPFR_ASSERTN(inex != 0); /* sqrt(2) is not exact */ - mpfr_mul_2exp (c, b, 1, MPFR_RNDN); + mpfr_mul_2ui (c, b, 1, MPFR_RNDN); mpfr_sqr (c, c, MPFR_RNDN); mpfr_clear_flags (); inex = mpfr_sqr (a, b, MPFR_RNDN); @@ -319,7 +319,7 @@ coverage (mpfr_prec_t pmax) mpfr_set_ui_2exp (b, 1, mpfr_get_emin () - 1, MPFR_RNDN); inex = mpfr_sqrt (b, b, MPFR_RNDZ); MPFR_ASSERTN(inex != 0); /* sqrt(2) is not exact */ - mpfr_mul_2exp (c, b, 1, MPFR_RNDN); + mpfr_mul_2ui (c, b, 1, MPFR_RNDN); mpfr_sqr (c, c, MPFR_RNDU); mpfr_clear_flags (); inex = mpfr_sqr (a, b, MPFR_RNDU); diff --git a/tests/tsqrt.c b/tests/tsqrt.c index 6cf0cbee5..b6704ddf3 100644 --- a/tests/tsqrt.c +++ b/tests/tsqrt.c @@ -289,7 +289,7 @@ special (void) mpfr_set_prec (x, 53); mpfr_set_str (x, "8093416094703476.0", 10, MPFR_RNDN); - mpfr_div_2exp (x, x, 1075, MPFR_RNDN); + mpfr_div_2ui (x, x, 1075, MPFR_RNDN); test_sqrt (x, x, MPFR_RNDN); mpfr_set_str (z, "1e55596835b5ef@-141", 16, MPFR_RNDN); if (mpfr_cmp (x, z)) @@ -341,7 +341,7 @@ special (void) mpfr_set_prec (z, GMP_NUMB_BITS - 1); mpfr_set_prec (y, GMP_NUMB_BITS - 1); mpfr_set_ui (y, 1, MPFR_RNDN); - mpfr_mul_2exp (y, y, GMP_NUMB_BITS - 1, MPFR_RNDN); + mpfr_mul_2ui (y, y, GMP_NUMB_BITS - 1, MPFR_RNDN); mpfr_nextabove (y); for (p = 2 * GMP_NUMB_BITS - 1; p <= 1000; p++) { @@ -674,7 +674,7 @@ test_sqrt1n (void) MPFR_ASSERTN(inex == 0); inex = mpfr_add_ui (u, u, 1, MPFR_RNDN); MPFR_ASSERTN(inex == 0); - inex = mpfr_mul_2exp (u, u, GMP_NUMB_BITS, MPFR_RNDN); + inex = mpfr_mul_2ui (u, u, GMP_NUMB_BITS, MPFR_RNDN); MPFR_ASSERTN(inex == 0); /* u = 2^(2*GMP_NUMB_BITS-2) + 2^GMP_NUMB_BITS, thus u = r^2 + 2^GMP_NUMB_BITS with r = 2^(GMP_NUMB_BITS-1). @@ -706,7 +706,7 @@ check_overflow (void) mpfr_set_emax (-1); mpfr_set_ui_2exp (u, 1, mpfr_get_emax () - 1, MPFR_RNDN); mpfr_nextbelow (u); - mpfr_mul_2exp (u, u, 1, MPFR_RNDN); + mpfr_mul_2ui (u, u, 1, MPFR_RNDN); /* now u = (1 - 2^(-p))*2^emax is the largest number < +Inf, it square root is near 0.707 and has exponent 0 > emax */ /* for RNDN, the result should be +Inf */ @@ -725,7 +725,7 @@ check_overflow (void) mpfr_set_emax (0); mpfr_set_ui_2exp (u, 1, mpfr_get_emax () - 1, MPFR_RNDN); mpfr_nextbelow (u); - mpfr_mul_2exp (u, u, 1, MPFR_RNDN); + mpfr_mul_2ui (u, u, 1, MPFR_RNDN); /* u = 1-2^(-p), its square root is > u, and should thus give +Inf when rounding away */ inex = mpfr_sqrt (r, u, MPFR_RNDA); diff --git a/tests/tsub.c b/tests/tsub.c index 572f616c9..d9019b44c 100644 --- a/tests/tsub.c +++ b/tests/tsub.c @@ -337,7 +337,7 @@ check_diverse (void) mpfr_set_prec (x, 33); mpfr_set_ui (x, 1, MPFR_RNDN); - mpfr_div_2exp (x, x, 32, MPFR_RNDN); + mpfr_div_2ui (x, x, 32, MPFR_RNDN); mpfr_sub_ui (x, x, 1, MPFR_RNDN); mpfr_set_prec (x, 5); @@ -398,7 +398,7 @@ bug_ddefour(void) mpfr_init2(tot1, 150); mpfr_set_ui( ex, 1, MPFR_RNDN); - mpfr_mul_2exp( ex, ex, 906, MPFR_RNDN); + mpfr_mul_2ui( ex, ex, 906, MPFR_RNDN); mpfr_log( tot, ex, MPFR_RNDN); mpfr_set( ex1, tot, MPFR_RNDN); /* ex1 = high(tot) */ test_sub( ex2, tot, ex1, MPFR_RNDN); /* ex2 = high(tot - ex1) */ @@ -481,10 +481,10 @@ check_inexact (void) mpfr_set_prec (x, 2); mpfr_set_ui (x, 6, MPFR_RNDN); - mpfr_div_2exp (x, x, 4, MPFR_RNDN); /* x = 6/16 */ + mpfr_div_2ui (x, x, 4, MPFR_RNDN); /* x = 6/16 */ mpfr_set_prec (y, 2); mpfr_set_si (y, -1, MPFR_RNDN); - mpfr_div_2exp (y, y, 4, MPFR_RNDN); /* y = -1/16 */ + mpfr_div_2ui (y, y, 4, MPFR_RNDN); /* y = -1/16 */ inexact = test_sub (y, y, x, MPFR_RNDN); /* y = round(-7/16) = -1/2 */ if (inexact >= 0) { @@ -962,7 +962,7 @@ test_rndf_exact (mp_size_t pmax) for (eb = 0; eb <= pmax + 3; eb ++) { mpfr_urandomb (b, RANDS); - mpfr_mul_2exp (b, b, eb, MPFR_RNDN); + mpfr_mul_2ui (b, b, eb, MPFR_RNDN); for (pc = MPFR_PREC_MIN; pc <= pmax; pc++) { if ((pc + 2) % GMP_NUMB_BITS > 4) diff --git a/tests/tsub1sp.c b/tests/tsub1sp.c index ff3c1506b..66b845000 100644 --- a/tests/tsub1sp.c +++ b/tests/tsub1sp.c @@ -181,13 +181,13 @@ compare_sub_sub1sp (void) mpfr_set_ui_2exp (b, 1, d, MPFR_RNDN); if (i & 1) { - mpfr_mul_2exp (b, b, 1, MPFR_RNDN); + mpfr_mul_2ui (b, b, 1, MPFR_RNDN); mpfr_nextbelow (b); } mpfr_set_ui_2exp (c, 1, 0, MPFR_RNDN); if (i & 2) { - mpfr_mul_2exp (c, c, 1, MPFR_RNDN); + mpfr_mul_2ui (c, c, 1, MPFR_RNDN); mpfr_nextbelow (c); } RND_LOOP_NO_RNDF (r) @@ -260,13 +260,13 @@ bug20171213_gen (mpfr_prec_t pmax) mpfr_set_ui (b, 1, MPFR_RNDN); mpfr_set_ui_2exp (c, 1, p + 1 - e, MPFR_RNDN); /* c = 2^(p + 1 - e) */ mpfr_sub_ui (c, c, 1, MPFR_RNDN); /* c = 2^(p + 1 - e) - 1 */ - mpfr_div_2exp (c, c, p + 1, MPFR_RNDN); /* c = 2^(-e) - 2^(-p-1) */ + mpfr_div_2ui (c, c, p + 1, MPFR_RNDN); /* c = 2^(-e) - 2^(-p-1) */ /* the exact difference is 1 - 2^(-e) + 2^(-p-1) */ mpfr_sub (a, b, c, MPFR_RNDN); /* check that a = 1 - 2^(-e) */ mpfr_set_ui_2exp (d, 1, e, MPFR_RNDN); /* b = 2^e */ mpfr_sub_ui (d, d, 1, MPFR_RNDN); /* b = 2^e - 1 */ - mpfr_div_2exp (d, d, e, MPFR_RNDN); /* b = 1 - 2^(-e) */ + mpfr_div_2ui (d, d, e, MPFR_RNDN); /* b = 1 - 2^(-e) */ if (! mpfr_equal_p (a, d)) { printf ("bug20171213_gen failed for p=%ld, e=%ld\n", @@ -935,10 +935,10 @@ check_corner (mpfr_prec_t p) for (e = 0; e < p; e++) { /* add 2^(-e) to z */ - mpfr_mul_2exp (z, z, e, MPFR_RNDN); + mpfr_mul_2ui (z, z, e, MPFR_RNDN); inex = mpfr_add_ui (z, z, 1, MPFR_RNDN); MPFR_ASSERTN(inex == 0); - mpfr_div_2exp (z, z, e, MPFR_RNDN); + mpfr_div_2ui (z, z, e, MPFR_RNDN); /* compute x = y - z which should be exact, near 2-2^(-e) */ inex = mpfr_sub (x, y, z, MPFR_RNDN); @@ -946,16 +946,16 @@ check_corner (mpfr_prec_t p) MPFR_ASSERTN(mpfr_get_exp (x) == 1); /* restore initial z */ - mpfr_mul_2exp (z, z, e, MPFR_RNDN); + mpfr_mul_2ui (z, z, e, MPFR_RNDN); inex = mpfr_sub_ui (z, z, 1, MPFR_RNDN); MPFR_ASSERTN(inex == 0); - mpfr_div_2exp (z, z, e, MPFR_RNDN); + mpfr_div_2ui (z, z, e, MPFR_RNDN); /* subtract 2^(-e) to z */ - mpfr_mul_2exp (z, z, e, MPFR_RNDN); + mpfr_mul_2ui (z, z, e, MPFR_RNDN); inex = mpfr_sub_ui (z, z, 1, MPFR_RNDN); MPFR_ASSERTN(inex == 0); - mpfr_div_2exp (z, z, e, MPFR_RNDN); + mpfr_div_2ui (z, z, e, MPFR_RNDN); /* ensure last significant bit of z is 0 so that y-z is exact */ odd = mpfr_min_prec (z) == p; @@ -970,10 +970,10 @@ check_corner (mpfr_prec_t p) /* restore initial z */ if (odd) mpfr_nextbelow (z); - mpfr_mul_2exp (z, z, e, MPFR_RNDN); + mpfr_mul_2ui (z, z, e, MPFR_RNDN); inex = mpfr_add_ui (z, z, 1, MPFR_RNDN); MPFR_ASSERTN(inex == 0); - mpfr_div_2exp (z, z, e, MPFR_RNDN); + mpfr_div_2ui (z, z, e, MPFR_RNDN); } mpfr_clears (x, y, z, (mpfr_ptr) 0); } |