summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/tabs.c6
-rw-r--r--tests/tacos.c14
-rw-r--r--tests/tadd.c24
-rw-r--r--tests/tadd1sp.c20
-rw-r--r--tests/tadd_ui.c2
-rw-r--r--tests/tasin.c14
-rw-r--r--tests/tatan.c22
-rw-r--r--tests/tcan_round.c4
-rw-r--r--tests/tcbrt.c12
-rw-r--r--tests/tcmp.c19
-rw-r--r--tests/tcmpabs.c10
-rw-r--r--tests/tconst_euler.c12
-rw-r--r--tests/tconst_log2.c4
-rw-r--r--tests/tconst_pi.c4
-rw-r--r--tests/tdiv.c12
-rw-r--r--tests/tdiv_ui.c8
-rw-r--r--tests/teq.c4
-rw-r--r--tests/texceptions.c23
-rw-r--r--tests/texp.c2
-rw-r--r--tests/tfactorial.c22
-rw-r--r--tests/tfma.c2
-rw-r--r--tests/tfrac.c10
-rw-r--r--tests/tgeneric.c2
-rw-r--r--tests/tget_d_2exp.c2
-rw-r--r--tests/tget_sj.c12
-rw-r--r--tests/tget_str.c8
-rw-r--r--tests/tgmpop.c26
-rw-r--r--tests/thypot.c2
-rw-r--r--tests/tlog.c2
-rw-r--r--tests/tmul.c2
-rw-r--r--tests/tmul_ui.c6
-rw-r--r--tests/tout_str.c2
-rw-r--r--tests/toutimpl.c2
-rw-r--r--tests/tpow.c14
-rw-r--r--tests/tpow3.c2
-rw-r--r--tests/tpow_z.c4
-rw-r--r--tests/trint.c24
-rw-r--r--tests/tset.c4
-rw-r--r--tests/tset_d.c15
-rw-r--r--tests/tset_f.c10
-rw-r--r--tests/tset_ld.c6
-rw-r--r--tests/tset_q.c18
-rw-r--r--tests/tset_si.c18
-rw-r--r--tests/tset_str.c10
-rw-r--r--tests/tset_z.c20
-rw-r--r--tests/tsqr.c14
-rw-r--r--tests/tsqrt.c2
-rw-r--r--tests/tsub.c4
-rw-r--r--tests/tsub1sp.c136
-rw-r--r--tests/tsum.c10
-rw-r--r--tests/tui_div.c8
-rw-r--r--tests/tui_pow.c2
-rw-r--r--tests/tzeta.c2
53 files changed, 323 insertions, 316 deletions
diff --git a/tests/tabs.c b/tests/tabs.c
index 97cb83910..6083ef300 100644
--- a/tests/tabs.c
+++ b/tests/tabs.c
@@ -30,7 +30,7 @@ check_inexact (void)
{
mp_prec_t p, q;
mpfr_t x, y, absx;
- mp_rnd_t rnd;
+ int rnd;
int inexact, cmp;
mpfr_init (x);
@@ -54,7 +54,7 @@ check_inexact (void)
mpfr_set_prec (y, q);
for (rnd = 0; rnd < GMP_RND_MAX; rnd++)
{
- inexact = mpfr_abs (y, x, rnd);
+ inexact = mpfr_abs (y, x, (mp_rnd_t) rnd);
cmp = mpfr_cmp (y, absx);
if (((inexact == 0) && (cmp != 0)) ||
((inexact > 0) && (cmp <= 0)) ||
@@ -138,7 +138,7 @@ check_cmp(int argc, char *argv[])
mpfr_random(x);
MPFR_SET_SIGN(x, sign);
rnd = RND_RAND();
- mpfr_abs(y, x, rnd);
+ mpfr_abs(y, x, (mp_rnd_t) rnd);
MPFR_SET_POS(x);
if (mpfr_cmp(x,y))
{
diff --git a/tests/tacos.c b/tests/tacos.c
index cf045fc2e..991b50258 100644
--- a/tests/tacos.c
+++ b/tests/tacos.c
@@ -98,7 +98,7 @@ int
main (void)
{
mpfr_t x, y;
- mp_rnd_t r;
+ int r;
tests_start_mpfr ();
@@ -145,13 +145,13 @@ main (void)
for (r = 0; r < GMP_RND_MAX; r++)
{
mpfr_set_ui (x, 0, GMP_RNDN); /* exact */
- mpfr_acos (y, x, r);
- mpfr_const_pi (x, r);
+ mpfr_acos (y, x, (mp_rnd_t) r);
+ mpfr_const_pi (x, (mp_rnd_t) r);
mpfr_div_2exp (x, x, 1, GMP_RNDN); /* exact */
if (mpfr_cmp (x, y))
{
printf ("Error: acos(0) != Pi/2 for rnd=%s\n",
- mpfr_print_rnd_mode (r));
+ mpfr_print_rnd_mode ((mp_rnd_t) r));
exit (1);
}
}
@@ -160,12 +160,12 @@ main (void)
for (r = 0; r < GMP_RND_MAX; r++)
{
mpfr_set_si (x, -1, GMP_RNDN); /* exact */
- mpfr_acos (y, x, r);
- mpfr_const_pi (x, r);
+ mpfr_acos (y, x, (mp_rnd_t) r);
+ mpfr_const_pi (x, (mp_rnd_t) r);
if (mpfr_cmp (x, y))
{
printf ("Error: acos(1) != Pi for rnd=%s\n",
- mpfr_print_rnd_mode (r));
+ mpfr_print_rnd_mode ((mp_rnd_t) r));
exit (1);
}
}
diff --git a/tests/tadd.c b/tests/tadd.c
index 1b908095d..80b7e9601 100644
--- a/tests/tadd.c
+++ b/tests/tadd.c
@@ -509,7 +509,7 @@ check_inexact (void)
abs(EXP(x)-EXP(u)) + max(prec(x), prec(u)) + 1 */
pz = pz + MAX(MPFR_PREC(x), MPFR_PREC(u)) + 1;
mpfr_set_prec (z, pz);
- rnd = RND_RAND();
+ rnd = (mp_rnd_t) RND_RAND();
if (test_add (z, x, u, rnd))
{
printf ("z <- x + u should be exact\n");
@@ -519,7 +519,7 @@ check_inexact (void)
exit (1);
}
{
- rnd = RND_RAND();
+ rnd = (mp_rnd_t) RND_RAND();
inexact = test_add (y, x, u, rnd);
cmp = mpfr_cmp (y, z);
if (((inexact == 0) && (cmp != 0)) ||
@@ -614,7 +614,7 @@ check_overflow (void)
{
mpfr_t a, b, c;
mp_prec_t prec_a;
- mp_rnd_t r;
+ int r;
mpfr_init2 (a, 256);
mpfr_init2 (b, 256);
@@ -629,7 +629,7 @@ check_overflow (void)
{
mpfr_set_prec (a, prec_a);
mpfr_clear_overflow ();
- test_add (a, b, c, r);
+ test_add (a, b, c, (mp_rnd_t) r);
if (!mpfr_overflow_p ())
{
printf ("No overflow in check_overflow\n");
@@ -695,7 +695,7 @@ check_1111 (void)
mpfr_add (c, c, one, GMP_RNDN);
diff = (randlimb () % (2*m)) - m;
mpfr_mul_2si (c, c, diff, GMP_RNDN);
- rnd_mode = RND_RAND ();
+ rnd_mode = (mp_rnd_t) RND_RAND ();
inex_a = test_add (a, b, c, rnd_mode);
mpfr_init2 (s, MPFR_PREC_MIN + 2*m);
inex_s = mpfr_add (s, b, c, GMP_RNDN); /* exact */
@@ -740,15 +740,15 @@ check_1minuseps (void)
0, 1, 2, 3, 4, 29, 30, 31, 32, 33, 34, 35, 61, 62, 63, 64, 65, 66, 67
};
mpfr_t a, b, c;
- int ia, ib, ic;
+ unsigned int ia, ib, ic;
mpfr_init2 (c, MPFR_PREC_MIN);
- for (ia = 0; ia < numberof(prec_a); ia++)
+ for (ia = 0; ia < numberof (prec_a); ia++)
for (ib = 0; ib < numberof(supp_b); ib++)
{
mp_prec_t prec_b;
- mp_rnd_t rnd_mode;
+ int rnd_mode;
prec_b = prec_a[ia] + supp_b[ib];
@@ -767,23 +767,23 @@ check_1minuseps (void)
mpfr_set_ui (c, 1, GMP_RNDN);
mpfr_div_ui (c, c, prec_a[ia] + supp_b[ic], GMP_RNDN);
- inex_a = test_add (a, b, c, rnd_mode);
+ inex_a = test_add (a, b, c, (mp_rnd_t) rnd_mode);
mpfr_init2 (s, 256);
inex_s = mpfr_add (s, b, c, GMP_RNDN); /* exact */
if (inex_s)
{
printf ("check_1minuseps: result should have been exact "
- "(ia = %d, ib = %d, ic = %d)\n", ia, ib, ic);
+ "(ia = %u, ib = %u, ic = %u)\n", ia, ib, ic);
exit (1);
}
- inex_s = mpfr_prec_round (s, prec_a[ia], rnd_mode);
+ inex_s = mpfr_prec_round (s, prec_a[ia], (mp_rnd_t) rnd_mode);
if ((inex_a < 0 && inex_s >= 0) ||
(inex_a == 0 && inex_s != 0) ||
(inex_a > 0 && inex_s <= 0) ||
!mpfr_equal_p (a, s))
{
printf ("check_1minuseps: results are different.\n");
- printf ("ia = %d, ib = %d, ic = %d\n", ia, ib, ic);
+ printf ("ia = %u, ib = %u, ic = %u\n", ia, ib, ic);
exit (1);
}
mpfr_clear (s);
diff --git a/tests/tadd1sp.c b/tests/tadd1sp.c
index 04d769d52..bc93cb58f 100644
--- a/tests/tadd1sp.c
+++ b/tests/tadd1sp.c
@@ -67,7 +67,7 @@ int main(void)
#define STD_ERROR \
{\
printf("ERROR: for %s and p=%lu and i=%d:\nB=",\
- mpfr_print_rnd_mode(r), p, i);\
+ mpfr_print_rnd_mode ((mp_rnd_t) r), p, i);\
mpfr_print_binary(b);\
printf("\nC="); mpfr_print_binary(c);\
printf("\nadd1 : "); mpfr_print_binary(a1);\
@@ -79,7 +79,7 @@ int main(void)
#define STD_ERROR2 \
{\
printf("ERROR: Wrong inexact flag for %s and p=%lu and i=%d:\nB=",\
- mpfr_print_rnd_mode(r), p, i);\
+ mpfr_print_rnd_mode ((mp_rnd_t) r), p, i);\
mpfr_print_binary(b);\
printf("\nC="); mpfr_print_binary(c);\
printf("\nA="); mpfr_print_binary(a1);\
@@ -99,7 +99,7 @@ int main(void)
void check_random(mp_prec_t p)
{
mpfr_t a1,b,c,a2;
- mp_rnd_t r;
+ int r;
int i, inexact1, inexact2;
mpfr_inits2(p, a1,b,c,a2, NULL);
@@ -115,8 +115,8 @@ void check_random(mp_prec_t p)
if (MPFR_IS_PURE_FP(b) && MPFR_IS_PURE_FP(c))
for (r = 0 ; r < GMP_RND_MAX ; r++)
{
- inexact1 = mpfr_add1(a1, b, c, r);
- inexact2 = mpfr_add1sp(a2, b, c, r);
+ inexact1 = mpfr_add1(a1, b, c, (mp_rnd_t) r);
+ inexact2 = mpfr_add1sp(a2, b, c, (mp_rnd_t) r);
if (mpfr_cmp(a1, a2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -131,7 +131,7 @@ void check_random(mp_prec_t p)
void check_special(void)
{
mpfr_t a1,a2,b,c;
- mp_rnd_t r;
+ int r;
mpfr_prec_t p;
int i = -1, inexact1, inexact2;
@@ -142,16 +142,16 @@ void check_special(void)
SET_PREC(53);
mpfr_set_str1 (b, "1@100");
mpfr_set_str1 (c, "1@1");
- inexact1 = mpfr_add1(a1, b, c, r);
- inexact2 = mpfr_add1sp(a2, b, c, r);
+ inexact1 = mpfr_add1(a1, b, c, (mp_rnd_t) r);
+ inexact2 = mpfr_add1sp(a2, b, c, (mp_rnd_t) r);
if (mpfr_cmp(a1, a2))
STD_ERROR;
if (inexact1 != inexact2)
STD_ERROR2;
mpfr_set_str_binary (b, "1E53");
mpfr_set_str_binary (c, "1E0");
- inexact1 = mpfr_add1(a1, b, c, r);
- inexact2 = mpfr_add1sp(a2, b, c, r);
+ inexact1 = mpfr_add1(a1, b, c, (mp_rnd_t) r);
+ inexact2 = mpfr_add1sp(a2, b, c, (mp_rnd_t) r);
if (mpfr_cmp(a1, a2))
STD_ERROR;
if (inexact1 != inexact2)
diff --git a/tests/tadd_ui.c b/tests/tadd_ui.c
index 059755669..da5ccbb8c 100644
--- a/tests/tadd_ui.c
+++ b/tests/tadd_ui.c
@@ -27,7 +27,7 @@ MA 02111-1307, USA. */
/* checks that x+y gives the right results with 53 bits of precision */
static void
-check3 (const char *xs, unsigned long y, unsigned int rnd_mode, const char *zs)
+check3 (const char *xs, unsigned long y, mp_rnd_t rnd_mode, const char *zs)
{
mpfr_t xx, zz;
diff --git a/tests/tasin.c b/tests/tasin.c
index f09ed4235..c6cb63298 100644
--- a/tests/tasin.c
+++ b/tests/tasin.c
@@ -32,7 +32,7 @@ static void
special (void)
{
mpfr_t x, y;
- mp_rnd_t r;
+ int r;
mpfr_init (x);
mpfr_init (y);
@@ -98,13 +98,13 @@ special (void)
for (r = 0; r < GMP_RND_MAX; r++)
{
mpfr_set_ui (x, 1, GMP_RNDN); /* exact */
- mpfr_asin (y, x, r);
- mpfr_const_pi (x, r);
+ mpfr_asin (y, x, (mp_rnd_t) r);
+ mpfr_const_pi (x, (mp_rnd_t) r);
mpfr_div_2exp (x, x, 1, GMP_RNDN); /* exact */
if (mpfr_cmp (x, y))
{
printf ("Error: asin(1) != Pi/2 for rnd=%s\n",
- mpfr_print_rnd_mode (r));
+ mpfr_print_rnd_mode ((mp_rnd_t) r));
exit (1);
}
}
@@ -113,14 +113,14 @@ special (void)
for (r = 0; r < GMP_RND_MAX; r++)
{
mpfr_set_si (x, -1, GMP_RNDN); /* exact */
- mpfr_asin (y, x, r);
- mpfr_const_pi (x, MPFR_INVERT_RND(r));
+ mpfr_asin (y, x, (mp_rnd_t) r);
+ mpfr_const_pi (x, MPFR_INVERT_RND((mp_rnd_t) r));
mpfr_neg (x, x, GMP_RNDN); /* exact */
mpfr_div_2exp (x, x, 1, GMP_RNDN); /* exact */
if (mpfr_cmp (x, y))
{
printf ("Error: asin(-1) != -Pi/2 for rnd=%s\n",
- mpfr_print_rnd_mode (r));
+ mpfr_print_rnd_mode ((mp_rnd_t) r));
exit (1);
}
}
diff --git a/tests/tatan.c b/tests/tatan.c
index dd68490d2..f1857538b 100644
--- a/tests/tatan.c
+++ b/tests/tatan.c
@@ -29,7 +29,7 @@ static void
special (void)
{
mpfr_t x, y, z;
- mp_rnd_t r;
+ int r;
int i;
mpfr_init2 (x, 53);
@@ -56,12 +56,13 @@ special (void)
for (r = 0; r < GMP_RND_MAX ; r++)
{
mpfr_set_inf (x, 1);
- mpfr_atan (y, x, r);
- mpfr_const_pi (x, r);
- mpfr_div_2exp (x, x, 1, r);
+ mpfr_atan (y, x, (mp_rnd_t) r);
+ mpfr_const_pi (x, (mp_rnd_t) r);
+ mpfr_div_2exp (x, x, 1, (mp_rnd_t) r);
if (mpfr_cmp (x, y))
{
- printf ("Error: mpfr_atan(+Inf), rnd=%s\n", mpfr_print_rnd_mode (r));
+ printf ("Error: mpfr_atan(+Inf), rnd=%s\n",
+ mpfr_print_rnd_mode ((mp_rnd_t) r));
exit (1);
}
}
@@ -70,13 +71,14 @@ special (void)
for (r = 0; r < GMP_RND_MAX ; r++)
{
mpfr_set_inf (x, -1);
- mpfr_atan (y, x, r);
- mpfr_const_pi (x, MPFR_INVERT_RND(r));
- mpfr_neg (x, x, r);
- mpfr_div_2exp (x, x, 1, r);
+ mpfr_atan (y, x, (mp_rnd_t) r);
+ mpfr_const_pi (x, MPFR_INVERT_RND((mp_rnd_t) r));
+ mpfr_neg (x, x, (mp_rnd_t) r);
+ mpfr_div_2exp (x, x, 1, (mp_rnd_t) r);
if (mpfr_cmp (x, y))
{
- printf ("Error: mpfr_atan(-Inf), rnd=%s\n", mpfr_print_rnd_mode (r));
+ printf ("Error: mpfr_atan(-Inf), rnd=%s\n",
+ mpfr_print_rnd_mode ((mp_rnd_t) r));
exit (1);
}
}
diff --git a/tests/tcan_round.c b/tests/tcan_round.c
index e0b1d0119..d4c3290d3 100644
--- a/tests/tcan_round.c
+++ b/tests/tcan_round.c
@@ -62,10 +62,10 @@ main (void)
for (i = 30; i < 99; i++)
for (j = 30; j < 99; j++)
{
- mp_rnd_t r1, r2;
+ int r1, r2;
for (r1 = 0; r1 < GMP_RND_MAX ; r1++)
for (r2 = 0; r2 < GMP_RND_MAX ; r2++)
- mpfr_can_round (x, i, r1, r2, j); /* test for assertions */
+ mpfr_can_round (x, i, (mp_rnd_t) r1, (mp_rnd_t) r2, j); /* test for assertions */
}
mpfr_clear (x);
diff --git a/tests/tcbrt.c b/tests/tcbrt.c
index bac5b7418..98d93a96b 100644
--- a/tests/tcbrt.c
+++ b/tests/tcbrt.c
@@ -136,7 +136,7 @@ int
main (void)
{
mpfr_t x;
- mp_rnd_t r;
+ int r;
mp_prec_t p;
tests_start_mpfr ();
@@ -151,21 +151,21 @@ main (void)
for (r = 0; r < GMP_RND_MAX; r++)
{
mpfr_set_ui (x, 1, GMP_RNDN);
- mpfr_cbrt (x, x, r);
+ mpfr_cbrt (x, x, (mp_rnd_t) r);
if (mpfr_cmp_ui (x, 1))
{
printf ("Error in mpfr_cbrt for x=1, rnd=%s\ngot ",
- mpfr_print_rnd_mode (r));
+ mpfr_print_rnd_mode ((mp_rnd_t) r));
mpfr_out_str (stdout, 2, 0, x, GMP_RNDN);
printf ("\n");
exit (1);
}
mpfr_set_si (x, -1, GMP_RNDN);
- mpfr_cbrt (x, x, r);
+ mpfr_cbrt (x, x, (mp_rnd_t) r);
if (mpfr_cmp_si (x, -1))
{
printf ("Error in mpfr_cbrt for x=-1, rnd=%s\ngot ",
- mpfr_print_rnd_mode (r));
+ mpfr_print_rnd_mode ((mp_rnd_t) r));
mpfr_out_str (stdout, 2, 0, x, GMP_RNDN);
printf ("\n");
exit (1);
@@ -183,7 +183,7 @@ main (void)
{
printf ("Error in mpfr_cbrt for "
"x = 27.0 * 2^(%d), rnd=%s\ngot ",
- 3*i, mpfr_print_rnd_mode (r));
+ 3*i, mpfr_print_rnd_mode ((mp_rnd_t) r));
mpfr_out_str (stdout, 2, 0, x, GMP_RNDN);
printf ("\ninstead of 3 * 2^(%d)\n", i);
exit (1);
diff --git a/tests/tcmp.c b/tests/tcmp.c
index 1fa7e0948..4dd97f8ba 100644
--- a/tests/tcmp.c
+++ b/tests/tcmp.c
@@ -76,23 +76,24 @@ main (void)
exit (1);
}
- mpfr_set_prec(xx, 53); mpfr_set_prec(yy, 200);
- mpfr_set_ui(xx, 1, 0);
- mpfr_set_ui(yy, 1, 0);
- if (mpfr_cmp(xx, yy) != 0)
+ mpfr_set_prec (xx, 53);
+ mpfr_set_prec (yy, 200);
+ mpfr_set_ui (xx, 1, (mp_rnd_t) 0);
+ mpfr_set_ui (yy, 1, (mp_rnd_t) 0);
+ if (mpfr_cmp (xx, yy) != 0)
{
printf ("Error in mpfr_cmp: 1.0 != 1.0\n");
exit (1);
}
- mpfr_set_prec(yy, 31);
- mpfr_set_str(xx, "1.0000000002", 10, 0);
- mpfr_set_ui(yy, 1, 0);
- if (!(mpfr_cmp(xx,yy)>0))
+ mpfr_set_prec (yy, 31);
+ mpfr_set_str (xx, "1.0000000002", 10, (mp_rnd_t) 0);
+ mpfr_set_ui (yy, 1, (mp_rnd_t) 0);
+ if (!(mpfr_cmp (xx,yy)>0))
{
printf ("Error in mpfr_cmp: not 1.0000000002 > 1.0\n");
exit (1);
}
- mpfr_set_prec(yy, 53);
+ mpfr_set_prec (yy, 53);
/* bug found by Gerardo Ballabio */
mpfr_set_ui(xx, 0, GMP_RNDN);
diff --git a/tests/tcmpabs.c b/tests/tcmpabs.c
index a0a9a9e9c..b3d4c05fe 100644
--- a/tests/tcmpabs.c
+++ b/tests/tcmpabs.c
@@ -65,14 +65,14 @@ main (void)
mpfr_set_prec(xx, 53);
mpfr_set_prec(yy, 200);
- mpfr_set_ui(xx, 1, 0);
- mpfr_set_ui(yy, 1, 0);
+ mpfr_set_ui (xx, 1, (mp_rnd_t) 0);
+ mpfr_set_ui (yy, 1, (mp_rnd_t) 0);
if (mpfr_cmpabs(xx, yy) != 0)
ERROR ("Error in mpfr_cmpabs: 1.0 != 1.0\n");
- mpfr_set_prec(yy, 31);
- mpfr_set_str(xx, "-1.0000000002", 10, 0);
- mpfr_set_ui(yy, 1, 0);
+ mpfr_set_prec (yy, 31);
+ mpfr_set_str (xx, "-1.0000000002", 10, (mp_rnd_t) 0);
+ mpfr_set_ui (yy, 1, (mp_rnd_t) 0);
if (!(mpfr_cmpabs(xx,yy)>0))
ERROR ("Error in mpfr_cmpabs: not 1.0000000002 > 1.0\n");
mpfr_set_prec(yy, 53);
diff --git a/tests/tconst_euler.c b/tests/tconst_euler.c
index c8354792b..68a39e1a3 100644
--- a/tests/tconst_euler.c
+++ b/tests/tconst_euler.c
@@ -29,7 +29,7 @@ main (int argc, char *argv[])
{
mpfr_t gamma, y, z, t;
unsigned int err, prec, yprec, p0 = 2, p1 = 200;
- mp_rnd_t rnd;
+ int rnd;
tests_start_mpfr ();
@@ -68,16 +68,16 @@ main (int argc, char *argv[])
for (rnd = 0; rnd < GMP_RND_MAX; rnd++)
{
mpfr_set_prec (y, yprec);
- mpfr_const_euler (y, rnd);
+ mpfr_const_euler (y, (mp_rnd_t) rnd);
err = (rnd == GMP_RNDN) ? yprec + 1 : yprec;
- if (mpfr_can_round (y, err, rnd, rnd, prec))
+ if (mpfr_can_round (y, err, (mp_rnd_t) rnd, (mp_rnd_t) rnd, prec))
{
- mpfr_set (t, y, rnd);
- mpfr_const_euler (z, rnd);
+ mpfr_set (t, y, (mp_rnd_t) rnd);
+ mpfr_const_euler (z, (mp_rnd_t) rnd);
if (mpfr_cmp (t, z))
{
printf ("results differ for prec=%u rnd_mode=%s\n", prec,
- mpfr_print_rnd_mode (rnd));
+ mpfr_print_rnd_mode ((mp_rnd_t) rnd));
printf (" got ");
mpfr_out_str (stdout, 2, prec, z, GMP_RNDN);
puts ("");
diff --git a/tests/tconst_log2.c b/tests/tconst_log2.c
index c90ebc209..0406647f6 100644
--- a/tests/tconst_log2.c
+++ b/tests/tconst_log2.c
@@ -44,7 +44,7 @@ check (mp_prec_t p0, mp_prec_t p1)
mpfr_set_prec (x, p0);
mpfr_set_prec (y, p0);
{
- rnd = RND_RAND ();
+ rnd = (mp_rnd_t) RND_RAND ();
mpfr_const_log2 (x, rnd);
mpfr_set (y, z, rnd);
if ((dif = mpfr_cmp (x, y))
@@ -134,7 +134,7 @@ main (int argc, char *argv[])
tests_start_mpfr ();
p = (argc>1) ? atoi(argv[1]) : 53;
- rnd = (argc>2) ? atoi(argv[2]) : GMP_RNDZ;
+ rnd = (argc>2) ? (mp_rnd_t) atoi(argv[2]) : GMP_RNDZ;
mpfr_init (x);
diff --git a/tests/tconst_pi.c b/tests/tconst_pi.c
index 9fc388136..d50062275 100644
--- a/tests/tconst_pi.c
+++ b/tests/tconst_pi.c
@@ -55,7 +55,7 @@ main (int argc, char *argv[])
{
mpfr_t x;
int p;
- unsigned char rnd;
+ mp_rnd_t rnd;
tests_start_mpfr ();
@@ -67,7 +67,7 @@ main (int argc, char *argv[])
p = a;
}
- rnd = (argc > 2) ? atoi(argv[2]) : GMP_RNDZ;
+ rnd = (argc > 2) ? (mp_rnd_t) atoi(argv[2]) : GMP_RNDZ;
mpfr_init2 (x, p);
mpfr_const_pi (x, rnd);
diff --git a/tests/tdiv.c b/tests/tdiv.c
index b5d943113..338c76edb 100644
--- a/tests/tdiv.c
+++ b/tests/tdiv.c
@@ -223,11 +223,11 @@ check_convergence (void)
for (j = 0;j < GMP_RND_MAX; j++)
{
mpfr_set_ui (y, 1, GMP_RNDN);
- mpfr_div (y, x, y, j);
+ mpfr_div (y, x, y, (mp_rnd_t) j);
if (mpfr_cmp_ui (y, 1))
{
printf ("mpfr_div failed for x=1.0, y=1.0, prec=%d rnd=%s\n",
- i, mpfr_print_rnd_mode(j));
+ i, mpfr_print_rnd_mode ((mp_rnd_t) j));
printf ("got "); mpfr_print_binary(y); puts ("");
exit (1);
}
@@ -259,7 +259,7 @@ check_hard (void)
{
mpfr_t u, v, q, q2;
mp_prec_t precu, precv, precq;
- mp_rnd_t rnd;
+ int rnd;
int inex, inex2, i, j;
mpfr_init (q);
@@ -300,12 +300,12 @@ check_hard (void)
{
for (rnd = 0; rnd < GMP_RND_MAX; rnd++)
{
- inex = mpfr_div (q, u, v, rnd);
+ inex = mpfr_div (q, u, v, (mp_rnd_t) rnd);
inex2 = get_inexact (q, u, v);
if (inex_cmp (inex, inex2))
{
printf ("Wrong inexact flag for rnd=%s: expected %d, got %d\n",
- mpfr_print_rnd_mode (rnd), inex2, inex);
+ mpfr_print_rnd_mode ((mp_rnd_t) rnd), inex2, inex);
printf ("u= "); mpfr_dump (u);
printf ("v= "); mpfr_dump (v);
printf ("q= "); mpfr_dump (q);
@@ -549,7 +549,7 @@ check_inexact (void)
mpfr_set_prec (y, py);
mpfr_set_prec (z, py + pu);
{
- rnd = RND_RAND ();
+ rnd = (mp_rnd_t) RND_RAND ();
inexact = mpfr_div (y, x, u, rnd);
if (mpfr_mul (z, y, u, rnd))
{
diff --git a/tests/tdiv_ui.c b/tests/tdiv_ui.c
index 6acd3e1db..20b98f973 100644
--- a/tests/tdiv_ui.c
+++ b/tests/tdiv_ui.c
@@ -140,7 +140,7 @@ check_inexact (void)
mp_prec_t px, py;
int inexact, cmp;
unsigned long int u;
- mp_rnd_t rnd;
+ int rnd;
mpfr_init (x);
mpfr_init (y);
@@ -161,8 +161,8 @@ check_inexact (void)
mpfr_set_prec (z, py + mp_bits_per_limb);
for (rnd = 0; rnd < GMP_RND_MAX; rnd++)
{
- inexact = mpfr_div_ui (y, x, u, rnd);
- if (mpfr_mul_ui (z, y, u, rnd))
+ inexact = mpfr_div_ui (y, x, u, (mp_rnd_t) rnd);
+ if (mpfr_mul_ui (z, y, u, (mp_rnd_t) rnd))
{
printf ("z <- y * u should be exact for u=%lu\n", u);
printf ("y="); mpfr_print_binary (y); puts ("");
@@ -175,7 +175,7 @@ check_inexact (void)
((inexact < 0) && (cmp >= 0)))
{
printf ("Wrong inexact flag for u=%lu, rnd=%s\n", u,
- mpfr_print_rnd_mode(rnd));
+ mpfr_print_rnd_mode ((mp_rnd_t) rnd));
printf ("x="); mpfr_print_binary (x); puts ("");
printf ("y="); mpfr_print_binary (y); puts ("");
exit (1);
diff --git a/tests/teq.c b/tests/teq.c
index f0b7afb62..5fa7cedb1 100644
--- a/tests/teq.c
+++ b/tests/teq.c
@@ -75,8 +75,8 @@ special (void)
mpfr_init2 (y, 53);
mpfr_init2 (z, 53);
- mpfr_set_str (x, "1", 10, 0);
- mpfr_set_str (y, "1e-10000", 10, 0);
+ mpfr_set_str (x, "1", 10, (mp_rnd_t) 0);
+ mpfr_set_str (y, "1e-10000", 10, (mp_rnd_t) 0);
mpfr_add (z, x, y, GMP_RNDU);
for (i = 1; i <= 52; i++)
diff --git a/tests/texceptions.c b/tests/texceptions.c
index 138253479..bf88a0728 100644
--- a/tests/texceptions.c
+++ b/tests/texceptions.c
@@ -44,18 +44,19 @@ check_powerof2 (void)
static void
check_default_rnd (void)
{
- mp_rnd_t r, t;
+ int r;
+ mp_rnd_t t;
for(r = 0 ; r < GMP_RND_MAX ; r++)
{
- mpfr_set_default_rounding_mode (r);
+ mpfr_set_default_rounding_mode ((mp_rnd_t) r);
t = (mpfr_get_default_rounding_mode) ();
- if (r !=t)
+ if ((mp_rnd_t) r != t)
ERROR("ERROR in setting / getting default rounding mode (1)\n");
}
- mpfr_set_default_rounding_mode(4);
+ mpfr_set_default_rounding_mode ((mp_rnd_t) 4);
if (mpfr_get_default_rounding_mode() != GMP_RNDD)
ERROR("ERROR in setting / getting default rounding mode (2)\n");
- mpfr_set_default_rounding_mode(-1);
+ mpfr_set_default_rounding_mode((mp_rnd_t) -1);
if (mpfr_get_default_rounding_mode() != GMP_RNDD)
ERROR("ERROR in setting / getting default rounding mode (3)\n");
}
@@ -176,7 +177,7 @@ test_set_underflow (void)
mpfr_t x, zero, min;
mpfr_ptr r[4];
int t[4] = { 1, -1, 1, -1 };
- mp_rnd_t i;
+ int i;
int s;
mpfr_inits (x, zero, min, (mpfr_ptr) 0);
@@ -193,11 +194,11 @@ test_set_underflow (void)
int inex;
j = s < 0 && i > 1 ? 5 - i : i;
- inex = mpfr_set_underflow (x, i, s);
+ inex = mpfr_set_underflow (x, (mp_rnd_t) i, s);
if (mpfr_cmp (x, r[j]) || inex * t[j] <= 0)
{
printf ("Error in test_set_underflow, sign = %d,"
- " rnd_mode = %s\n", s, mpfr_print_rnd_mode (i));
+ " rnd_mode = %s\n", s, mpfr_print_rnd_mode ((mp_rnd_t) i));
printf ("Got\n");
mpfr_out_str (stdout, 2, 0, x, GMP_RNDN);
printf (", inex = %d\ninstead of\n", inex);
@@ -219,7 +220,7 @@ test_set_overflow (void)
mpfr_t x, inf, max;
mpfr_ptr r[4];
int t[4] = { 1, -1, 1, -1 };
- mp_rnd_t i;
+ int i;
int s;
mpfr_inits2 (32, x, inf, max, (mpfr_ptr) 0);
@@ -236,11 +237,11 @@ test_set_overflow (void)
int inex;
j = s < 0 && i > 1 ? 5 - i : i;
- inex = mpfr_set_overflow (x, i, s);
+ inex = mpfr_set_overflow (x, (mp_rnd_t) i, s);
if (mpfr_cmp (x, r[j]) || inex * t[j] <= 0)
{
printf ("Error in test_set_overflow, sign = %d,"
- " rnd_mode = %s\n", s, mpfr_print_rnd_mode (i));
+ " rnd_mode = %s\n", s, mpfr_print_rnd_mode ((mp_rnd_t) i));
printf ("Got\n");
mpfr_out_str (stdout, 2, 0, x, GMP_RNDN);
printf (", inex = %d\ninstead of\n", inex);
diff --git a/tests/texp.c b/tests/texp.c
index 153b200c5..09a5b14dc 100644
--- a/tests/texp.c
+++ b/tests/texp.c
@@ -142,7 +142,7 @@ compare_exp2_exp3 (int n)
mpfr_set_prec (y, prec);
mpfr_set_prec (z, prec);
mpfr_random (x);
- rnd = RND_RAND() ;
+ rnd = (mp_rnd_t) RND_RAND();
mpfr_exp_2 (y, x, rnd);
mpfr_exp_3 (z, x, rnd);
if (mpfr_cmp (y,z))
diff --git a/tests/tfactorial.c b/tests/tfactorial.c
index ce28a3de3..d821fc19d 100644
--- a/tests/tfactorial.c
+++ b/tests/tfactorial.c
@@ -74,7 +74,7 @@ test_int (void)
mpz_t f;
mpfr_t x, y;
mp_prec_t prec_f, p;
- mp_rnd_t r;
+ int r;
int inex1, inex2;
mpz_init (f);
@@ -92,19 +92,19 @@ test_int (void)
mpfr_set_prec (y, p);
for (r = 0; r < GMP_RND_MAX; r++)
{
- inex1 = mpfr_fac_ui (x, n, r);
- inex2 = mpfr_set_z (y, f, r);
+ inex1 = mpfr_fac_ui (x, n, (mp_rnd_t) r);
+ inex2 = mpfr_set_z (y, f, (mp_rnd_t) r);
if (mpfr_cmp (x, y))
{
printf ("Error for n=%lu prec=%lu rnd=%s\n",
- n, (unsigned long) p, mpfr_print_rnd_mode (r));
+ n, (unsigned long) p, mpfr_print_rnd_mode ((mp_rnd_t) r));
exit (1);
}
if ((inex1 < 0 && inex2 >= 0) || (inex1 == 0 && inex2 != 0)
|| (inex1 > 0 && inex2 <= 0))
{
printf ("Wrong inexact flag for n=%lu prec=%lu rnd=%s\n",
- n, (unsigned long) p, mpfr_print_rnd_mode (r));
+ n, (unsigned long) p, mpfr_print_rnd_mode ((mp_rnd_t) r));
exit (1);
}
}
@@ -120,7 +120,7 @@ int
main (int argc, char *argv[])
{
unsigned int prec, err, yprec, n, k, zeros;
- mp_rnd_t rnd;
+ int rnd;
mpfr_t x, y, z, t;
int inexact;
@@ -154,12 +154,12 @@ main (int argc, char *argv[])
for (n = 0; n < 50; n++)
for (rnd = 0; rnd < GMP_RND_MAX; rnd++)
{
- inexact = mpfr_fac_ui (y, n, rnd);
+ inexact = mpfr_fac_ui (y, n, (mp_rnd_t) rnd);
err = (rnd == GMP_RNDN) ? yprec + 1 : yprec;
- if (mpfr_can_round (y, err, rnd, rnd, prec))
+ if (mpfr_can_round (y, err, (mp_rnd_t) rnd, (mp_rnd_t) rnd, prec))
{
- mpfr_set (t, y, rnd);
- inexact = mpfr_fac_ui (z, n, rnd);
+ mpfr_set (t, y, (mp_rnd_t) rnd);
+ inexact = mpfr_fac_ui (z, n, (mp_rnd_t) rnd);
/* fact(n) ends with floor(n/2)+floor(n/4)+... zeros */
for (k=n/2, zeros=0; k; k >>= 1)
zeros += k;
@@ -187,7 +187,7 @@ main (int argc, char *argv[])
printf ("results differ for x=");
mpfr_out_str (stdout, 2, prec, x, GMP_RNDN);
printf (" prec=%u rnd_mode=%s\n", prec,
- mpfr_print_rnd_mode (rnd));
+ mpfr_print_rnd_mode ((mp_rnd_t) rnd));
printf (" got ");
mpfr_out_str (stdout, 2, prec, z, GMP_RNDN);
puts ("");
diff --git a/tests/tfma.c b/tests/tfma.c
index 8933476d2..2888dbef1 100644
--- a/tests/tfma.c
+++ b/tests/tfma.c
@@ -260,7 +260,7 @@ main (int argc, char *argv[])
if (randlimb () % 2)
mpfr_neg (z, z, GMP_RNDN);
- rnd = RND_RAND ();
+ rnd = (mp_rnd_t) RND_RAND ();
mpfr_set_prec (slong, 2 * prec);
if (mpfr_mul (slong, x, y, rnd))
{
diff --git a/tests/tfrac.c b/tests/tfrac.c
index 478e194f1..39d6648f3 100644
--- a/tests/tfrac.c
+++ b/tests/tfrac.c
@@ -113,16 +113,16 @@ check0 (mpfr_ptr ip, mpfr_ptr fp, mp_prec_t prec, mp_rnd_t rnd)
static void
check1 (mpfr_ptr ip, mpfr_ptr fp)
{
- mp_rnd_t rnd;
+ int rnd;
for (rnd = 0; rnd < GMP_RND_MAX ; rnd++)
{
- check0 (ip, fp, PMAX, rnd);
- check0 (ip, fp, 70, rnd);
+ check0 (ip, fp, PMAX, (mp_rnd_t) rnd);
+ check0 (ip, fp, 70, (mp_rnd_t) rnd);
mpfr_neg (fp, fp, GMP_RNDN);
mpfr_neg (ip, ip, GMP_RNDN);
- check0 (ip, fp, PMAX, rnd);
- check0 (ip, fp, 70, rnd);
+ check0 (ip, fp, PMAX, (mp_rnd_t) rnd);
+ check0 (ip, fp, 70, (mp_rnd_t) rnd);
mpfr_neg (fp, fp, GMP_RNDN);
mpfr_neg (ip, ip, GMP_RNDN);
}
diff --git a/tests/tgeneric.c b/tests/tgeneric.c
index b55cb8e1c..5bb266383 100644
--- a/tests/tgeneric.c
+++ b/tests/tgeneric.c
@@ -48,7 +48,7 @@ test_generic (mp_prec_t p0, mp_prec_t p1, unsigned int N)
#else
mpfr_random (x);
#endif
- rnd = RND_RAND ();
+ rnd = (mp_rnd_t) RND_RAND ();
mpfr_set_prec (y, yprec);
compare = TEST_FUNCTION (y, x, rnd);
if (mpfr_can_round (y, yprec, rnd, rnd, prec))
diff --git a/tests/tget_d_2exp.c b/tests/tget_d_2exp.c
index bb47abee4..bbd4215ec 100644
--- a/tests/tget_d_2exp.c
+++ b/tests/tget_d_2exp.c
@@ -49,7 +49,7 @@ check_round (void)
for (neg = 0; neg <= 1; neg++)
{
- got = mpfr_get_d_2exp (&got_exp, f, rnd_mode);
+ got = mpfr_get_d_2exp (&got_exp, f, (mp_rnd_t) rnd_mode);
if (neg == 0
? (got < 0.5 || got >= 1.0)
diff --git a/tests/tget_sj.c b/tests/tget_sj.c
index 77f3dde5c..4e43db0eb 100644
--- a/tests/tget_sj.c
+++ b/tests/tget_sj.c
@@ -62,7 +62,7 @@ check_sj (intmax_t s, mpfr_ptr x)
for (i = -1; i <= 1; i++)
{
- mpfr_rnd_t rnd;
+ int rnd;
mpfr_set_si_2exp (y, i, -2, GMP_RNDN);
mpfr_add (y, y, x, GMP_RNDN);
@@ -79,12 +79,12 @@ check_sj (intmax_t s, mpfr_ptr x)
if (rnd == GMP_RNDU && i > 0)
continue;
/* rint (y) == x == s */
- r = mpfr_get_sj (y, rnd);
+ r = mpfr_get_sj (y, (mp_rnd_t) rnd);
if (r != s)
{
printf ("Error in check_sj for y = ");
mpfr_out_str (stdout, 2, 0, y, GMP_RNDN);
- printf (" in %s\n", mpfr_print_rnd_mode (rnd));
+ printf (" in %s\n", mpfr_print_rnd_mode ((mp_rnd_t) rnd));
printf ("Got %jd instead of %jd.\n", r, s);
exit (1);
}
@@ -104,7 +104,7 @@ check_uj (uintmax_t u, mpfr_ptr x)
for (i = -1; i <= 1; i++)
{
- mpfr_rnd_t rnd;
+ int rnd;
mpfr_set_si_2exp (y, i, -2, GMP_RNDN);
mpfr_add (y, y, x, GMP_RNDN);
@@ -119,12 +119,12 @@ check_uj (uintmax_t u, mpfr_ptr x)
if (rnd == GMP_RNDU && i > 0)
continue;
/* rint (y) == x == u */
- r = mpfr_get_uj (y, rnd);
+ r = mpfr_get_uj (y, (mp_rnd_t) rnd);
if (r != u)
{
printf ("Error in check_uj for y = ");
mpfr_out_str (stdout, 2, 0, y, GMP_RNDN);
- printf (" in %s\n", mpfr_print_rnd_mode (rnd));
+ printf (" in %s\n", mpfr_print_rnd_mode ((mp_rnd_t) rnd));
printf ("Got %ju instead of %ju.\n", r, u);
exit (1);
}
diff --git a/tests/tget_str.c b/tests/tget_str.c
index f22a92492..5fa6062bd 100644
--- a/tests/tget_str.c
+++ b/tests/tget_str.c
@@ -963,7 +963,7 @@ check_special (int b, mp_prec_t p)
int i, j;
char s[MAX_DIGITS + 2], s2[MAX_DIGITS + 2], c;
mp_exp_t e;
- mp_rnd_t r;
+ int r;
size_t m;
/* check for invalid base */
@@ -982,7 +982,7 @@ check_special (int b, mp_prec_t p)
for (r = 0; r < GMP_RND_MAX; r++)
for (m= (i<3)? 2 : i-1 ; (int) m <= i+1 ; m++)
{
- mpfr_get_str (s, &e, b, m, x, r);
+ mpfr_get_str (s, &e, b, m, x, (mp_rnd_t) r);
/* s should be 1 followed by (m-1) zeros, and e should be i+1 */
if ((e != i+1) || strncmp (s, s2, m) != 0)
{
@@ -996,7 +996,7 @@ check_special (int b, mp_prec_t p)
for (r = 0; r < GMP_RND_MAX; r++)
if (i >= 2)
{
- mpfr_get_str (s, &e, b, i, x, r);
+ mpfr_get_str (s, &e, b, i, x, (mp_rnd_t) r);
/* should be i times (b-1) */
c = (b <= 10) ? '0' + b - 1 : 'a' + (b - 11);
for (j=0; (j < i) && (s[j] == c); j++);
@@ -1087,7 +1087,7 @@ main (int argc, char *argv[])
mpfr_set_exp (x, (e == -10) ? mpfr_get_emin () :
((e == 10) ? mpfr_get_emax () : e));
b = 2 + (randlimb () % 35);
- r = RND_RAND();
+ r = (mp_rnd_t) RND_RAND();
mpfr_get_str (s, &f, b, m, x, r);
}
mpfr_clear (x);
diff --git a/tests/tgmpop.c b/tests/tgmpop.c
index c97b5ccee..8f64fba61 100644
--- a/tests/tgmpop.c
+++ b/tests/tgmpop.c
@@ -118,7 +118,7 @@ check_for_zero ()
mpq_t q;
mpz_t z;
mpfr_t x;
- mp_rnd_t r;
+ int r;
mpfr_sign_t i;
mpfr_init (x);
@@ -135,43 +135,43 @@ check_for_zero ()
i+=MPFR_SIGN_POS-MPFR_SIGN_NEG)
{
MPFR_SET_SIGN(x, i);
- mpfr_add_z (x, x, z, r);
+ mpfr_add_z (x, x, z, (mp_rnd_t) r);
if (!MPFR_IS_ZERO(x) || MPFR_SIGN(x)!=i)
{
printf("GMP Zero errors for add_z & rnd=%s & s=%d\n",
- mpfr_print_rnd_mode(r), i);
+ mpfr_print_rnd_mode ((mp_rnd_t) r), i);
mpfr_dump (x);
exit (1);
}
- mpfr_sub_z (x, x, z, r);
+ mpfr_sub_z (x, x, z, (mp_rnd_t) r);
if (!MPFR_IS_ZERO(x) || MPFR_SIGN(x)!=i)
{
printf("GMP Zero errors for sub_z & rnd=%s & s=%d\n",
- mpfr_print_rnd_mode(r), i);
+ mpfr_print_rnd_mode ((mp_rnd_t) r), i);
mpfr_dump (x);
exit (1);
}
- mpfr_mul_z (x, x, z, r);
+ mpfr_mul_z (x, x, z, (mp_rnd_t) r);
if (!MPFR_IS_ZERO(x) || MPFR_SIGN(x)!=i)
{
printf("GMP Zero errors for mul_z & rnd=%s & s=%d\n",
- mpfr_print_rnd_mode(r), i);
+ mpfr_print_rnd_mode ((mp_rnd_t) r), i);
mpfr_dump (x);
exit (1);
}
- mpfr_add_q (x, x, q, r);
+ mpfr_add_q (x, x, q, (mp_rnd_t) r);
if (!MPFR_IS_ZERO(x) || MPFR_SIGN(x)!=i)
{
printf("GMP Zero errors for add_q & rnd=%s & s=%d\n",
- mpfr_print_rnd_mode(r), i);
+ mpfr_print_rnd_mode ((mp_rnd_t) r), i);
mpfr_dump (x);
exit (1);
}
- mpfr_sub_q (x, x, q, r);
+ mpfr_sub_q (x, x, q, (mp_rnd_t) r);
if (!MPFR_IS_ZERO(x) || MPFR_SIGN(x)!=i)
{
printf("GMP Zero errors for sub_q & rnd=%s & s=%d\n",
- mpfr_print_rnd_mode(r), i);
+ mpfr_print_rnd_mode ((mp_rnd_t) r), i);
mpfr_dump (x);
exit (1);
}
@@ -399,7 +399,7 @@ test_genericz (mp_prec_t p0, mp_prec_t p1, unsigned int N,
{
mpfr_urandomb (arg1, RANDS);
mpz_urandomb (arg2, RANDS, 1024);
- rnd = RND_RAND ();
+ rnd = (mp_rnd_t) RND_RAND ();
mpfr_set_prec (dst_big, 2*prec);
compare = func(dst_big, arg1, arg2, rnd);
if (mpfr_can_round (dst_big, 2*prec, rnd, rnd, prec))
@@ -477,7 +477,7 @@ test_genericq (mp_prec_t p0, mp_prec_t p1, unsigned int N,
mpfr_urandomb (arg1, RANDS);
mpq_set_ui (arg2, randlimb (), randlimb() );
mpq_canonicalize (arg2);
- rnd = RND_RAND ();
+ rnd = (mp_rnd_t) RND_RAND ();
mpfr_set_prec (dst_big, prec+10);
compare = func(dst_big, arg1, arg2, rnd);
if (mpfr_can_round (dst_big, prec+10, rnd, rnd, prec))
diff --git a/tests/thypot.c b/tests/thypot.c
index fdb7eefab..6de670b16 100644
--- a/tests/thypot.c
+++ b/tests/thypot.c
@@ -147,7 +147,7 @@ main (int argc, char *argv[])
mpfr_neg (x1, x1, GMP_RNDN);
if (randlimb () % 2)
mpfr_neg (x2, x2, GMP_RNDN);
- rnd = RND_RAND ();
+ rnd = (mp_rnd_t) RND_RAND ();
mpfr_set_prec (y, yprec);
compare =TEST_FUNCTION (y, x1,x2, rnd);
diff --git a/tests/tlog.c b/tests/tlog.c
index 8d839ee00..6358c8534 100644
--- a/tests/tlog.c
+++ b/tests/tlog.c
@@ -204,7 +204,7 @@ main (int argc, char *argv[])
if (argc==4)
{ /* tlog x prec rnd */
- check3 (atof(argv[1]), atoi(argv[2]), atoi(argv[3]));
+ check3 (atof(argv[1]), atoi(argv[2]), (mp_rnd_t) atoi(argv[3]));
goto done;
}
diff --git a/tests/tmul.c b/tests/tmul.c
index 51580b864..f46f12d51 100644
--- a/tests/tmul.c
+++ b/tests/tmul.c
@@ -217,7 +217,7 @@ check_exact (void)
{
mpfr_random (a);
mpfr_random (b);
- rnd = RND_RAND ();
+ rnd = (mp_rnd_t) RND_RAND ();
inexact = mpfr_mul (c, a, b, rnd);
if (mpfr_mul (d, a, b, rnd)) /* should be always exact */
{
diff --git a/tests/tmul_ui.c b/tests/tmul_ui.c
index 327e19f3c..45d0bdcd2 100644
--- a/tests/tmul_ui.c
+++ b/tests/tmul_ui.c
@@ -31,7 +31,7 @@ check_inexact (mp_prec_t p)
unsigned long u;
mp_prec_t q;
int inexact, cmp;
- mp_rnd_t rnd;
+ int rnd;
mpfr_init2 (x, p);
mpfr_init (y);
@@ -48,7 +48,7 @@ check_inexact (mp_prec_t p)
for (rnd = 0; rnd < GMP_RND_MAX; rnd++)
{
mpfr_set_prec (y, q);
- inexact = mpfr_mul_ui (y, x, u, rnd);
+ inexact = mpfr_mul_ui (y, x, u, (mp_rnd_t) rnd);
cmp = mpfr_cmp (y, z);
if (((inexact == 0) && (cmp != 0)) ||
((inexact < 0) && (cmp >= 0)) ||
@@ -56,7 +56,7 @@ check_inexact (mp_prec_t p)
{
printf ("Wrong inexact flag for p=%u, q=%u, rnd=%s\n",
(unsigned int) p, (unsigned int) q,
- mpfr_print_rnd_mode (rnd));
+ mpfr_print_rnd_mode ((mp_rnd_t) rnd));
exit (1);
}
}
diff --git a/tests/tout_str.c b/tests/tout_str.c
index bfa168a85..0c478b1d6 100644
--- a/tests/tout_str.c
+++ b/tests/tout_str.c
@@ -188,7 +188,7 @@ main (int argc, char *argv[])
#endif
r = RND_RAND ();
p = 2 + randlimb () % 35;
- check (d, r, p);
+ check (d, (mp_rnd_t) r, p);
}
fclose (fout);
diff --git a/tests/toutimpl.c b/tests/toutimpl.c
index 2fd4eacd6..e41133b51 100644
--- a/tests/toutimpl.c
+++ b/tests/toutimpl.c
@@ -65,7 +65,7 @@ int main()
printf ("Error for printing GMP_RNDZ\n");
exit (1);
}
- if (mpfr_print_rnd_mode (-1) != NULL ||
+ if (mpfr_print_rnd_mode ((mp_rnd_t) -1) != NULL ||
mpfr_print_rnd_mode (GMP_RND_MAX) != NULL)
{
printf ("Error for illegal rounding mode values.\n");
diff --git a/tests/tpow.c b/tests/tpow.c
index 510575632..73fe61d5d 100644
--- a/tests/tpow.c
+++ b/tests/tpow.c
@@ -208,7 +208,7 @@ check_inexact (mp_prec_t p)
unsigned long u;
mp_prec_t q;
int inexact, cmp;
- mp_rnd_t rnd;
+ int rnd;
mpfr_init2 (x, p);
mpfr_init (y);
@@ -222,15 +222,15 @@ check_inexact (mp_prec_t p)
mpfr_set_prec (y, q);
mpfr_set_prec (z, q + 10);
mpfr_set_prec (t, q);
- inexact = mpfr_pow_ui (y, x, u, rnd);
- cmp = mpfr_pow_ui (z, x, u, rnd);
- if (mpfr_can_round (z, q + 10, rnd, rnd, q))
+ inexact = mpfr_pow_ui (y, x, u, (mp_rnd_t) rnd);
+ cmp = mpfr_pow_ui (z, x, u, (mp_rnd_t) rnd);
+ if (mpfr_can_round (z, q + 10, (mp_rnd_t) rnd, (mp_rnd_t) rnd, q))
{
- cmp = mpfr_set (t, z, rnd) || cmp;
+ cmp = mpfr_set (t, z, (mp_rnd_t) rnd) || cmp;
if (mpfr_cmp (y, t))
{
printf ("results differ for u=%lu rnd=%s\n",
- u, mpfr_print_rnd_mode(rnd));
+ u, mpfr_print_rnd_mode ((mp_rnd_t) rnd));
printf ("x="); mpfr_print_binary (x); puts ("");
printf ("y="); mpfr_print_binary (y); puts ("");
printf ("t="); mpfr_print_binary (t); puts ("");
@@ -242,7 +242,7 @@ check_inexact (mp_prec_t p)
{
printf ("Wrong inexact flag for p=%u, q=%u, rnd=%s\n",
(unsigned int) p, (unsigned int) q,
- mpfr_print_rnd_mode (rnd));
+ mpfr_print_rnd_mode ((mp_rnd_t) rnd));
printf ("expected %d, got %d\n", cmp, inexact);
printf ("u=%lu x=", u); mpfr_print_binary (x); puts ("");
printf ("y="); mpfr_print_binary (y); puts ("");
diff --git a/tests/tpow3.c b/tests/tpow3.c
index 0626d51dc..7e1f67e06 100644
--- a/tests/tpow3.c
+++ b/tests/tpow3.c
@@ -65,7 +65,7 @@ main (int argc, char *argv[])
mpfr_random (s);
if (randlimb () % 2)
mpfr_neg (s, s, GMP_RNDN);
- rnd = RND_RAND ();
+ rnd = (mp_rnd_t) RND_RAND ();
mpfr_set_prec (y, yprec);
compare = mpfr_pow (y, x, s, rnd);
err = (rnd == GMP_RNDN) ? yprec + 1 : yprec;
diff --git a/tests/tpow_z.c b/tests/tpow_z.c
index edbd621d5..b8ac6a421 100644
--- a/tests/tpow_z.c
+++ b/tests/tpow_z.c
@@ -137,7 +137,7 @@ static void check_special (void) {
static void check_integer (mp_prec_t begin, mp_prec_t end, unsigned long max) {
mpfr_t x, y1, y2;
mpz_t z;
- long i, n;
+ unsigned long i, n;
mp_prec_t p;
int res1, res2;
mp_rnd_t rnd;
@@ -152,7 +152,7 @@ static void check_integer (mp_prec_t begin, mp_prec_t end, unsigned long max) {
mpz_random (z, (i&1) == 0 ? -1 : 1);
mpfr_random (x);
mpfr_mul_2ui (x, x, 1, GMP_RNDN); /* 0 <= x < 2 */
- rnd = RND_RAND ();
+ rnd = (mp_rnd_t) RND_RAND ();
if (mpz_fits_slong_p (z)) {
n = mpz_get_si (z);
/* printf ("New test for x=%ld\nCheck Pow_si\n", n); */
diff --git a/tests/trint.c b/tests/trint.c
index 9d07a79cb..5e2cceb5b 100644
--- a/tests/trint.c
+++ b/tests/trint.c
@@ -209,7 +209,7 @@ main (int argc, char *argv[])
mpz_t z;
mp_prec_t p;
mpfr_t x, y, t, u, v;
- mp_rnd_t r;
+ int r;
int inexact, sign_t;
tests_start_mpfr ();
@@ -250,7 +250,7 @@ main (int argc, char *argv[])
for (trint = 0; trint < 3; trint++)
{
if (trint == 2)
- inexact = mpfr_rint (y, x, r);
+ inexact = mpfr_rint (y, x, (mp_rnd_t) r);
else if (r == GMP_RNDN)
inexact = mpfr_round (y, x);
else if (r == GMP_RNDZ)
@@ -264,13 +264,13 @@ main (int argc, char *argv[])
mpfr_rint_floor (y, x, GMP_RNDD));
if (mpfr_sub (t, y, x, GMP_RNDN))
err ("subtraction 1 should be exact",
- s, x, y, p, r, trint, inexact);
+ s, x, y, p, (mp_rnd_t) r, trint, inexact);
sign_t = mpfr_cmp_ui (t, 0);
if (trint != 0 &&
(((inexact == 0) && (sign_t != 0)) ||
((inexact < 0) && (sign_t >= 0)) ||
((inexact > 0) && (sign_t <= 0))))
- err ("wrong inexact flag", s, x, y, p, r, trint, inexact);
+ err ("wrong inexact flag", s, x, y, p, (mp_rnd_t) r, trint, inexact);
if (inexact == 0)
continue; /* end of the test for exact results */
@@ -279,31 +279,31 @@ main (int argc, char *argv[])
((r == GMP_RNDU || (r == GMP_RNDZ && MPFR_SIGN (x) < 0))
&& inexact < 0))
err ("wrong rounding direction",
- s, x, y, p, r, trint, inexact);
+ s, x, y, p, (mp_rnd_t) r, trint, inexact);
if (inexact < 0)
{
mpfr_add_ui (v, y, 1, GMP_RNDU);
if (mpfr_cmp (v, x) <= 0)
err ("representable integer between x and its "
- "rounded value", s, x, y, p, r, trint, inexact);
+ "rounded value", s, x, y, p, (mp_rnd_t) r, trint, inexact);
}
else
{
mpfr_sub_ui (v, y, 1, GMP_RNDD);
if (mpfr_cmp (v, x) >= 0)
err ("representable integer between x and its "
- "rounded value", s, x, y, p, r, trint, inexact);
+ "rounded value", s, x, y, p, (mp_rnd_t) r, trint, inexact);
}
if (r == GMP_RNDN)
{
int cmp;
if (mpfr_sub (u, v, x, GMP_RNDN))
err ("subtraction 2 should be exact",
- s, x, y, p, r, trint, inexact);
+ s, x, y, p, (mp_rnd_t) r, trint, inexact);
cmp = mpfr_cmp_abs (t, u);
if (cmp > 0)
err ("faithful rounding, but not the nearest integer",
- s, x, y, p, r, trint, inexact);
+ s, x, y, p, (mp_rnd_t) r, trint, inexact);
if (cmp < 0)
continue;
/* |t| = |u|: x is the middle of two consecutive
@@ -315,7 +315,7 @@ main (int argc, char *argv[])
mpfr_div_2ui (y, y, 1, GMP_RNDZ);
if (!mpfr_integer_p (y))
err ("halfway case for mpfr_rint, result isn't an"
- " even integer", s, x, y, p, r, trint, inexact);
+ " even integer", s, x, y, p, (mp_rnd_t) r, trint, inexact);
/* If floor(x) and ceil(x) aren't both representable
integers, the mantissa must be even. */
mpfr_sub (v, v, y, GMP_RNDN);
@@ -326,7 +326,7 @@ main (int argc, char *argv[])
+ 1, GMP_RNDN);
if (!mpfr_integer_p (y))
err ("halfway case for mpfr_rint, mantissa isn't"
- " even", s, x, y, p, r, trint, inexact);
+ " even", s, x, y, p, (mp_rnd_t) r, trint, inexact);
}
}
else
@@ -335,7 +335,7 @@ main (int argc, char *argv[])
if ((MPFR_SIGN (x) > 0 && inexact < 0) ||
(MPFR_SIGN (x) < 0 && inexact > 0))
err ("halfway case for mpfr_round, bad rounding"
- " direction", s, x, y, p, r, trint, inexact);
+ " direction", s, x, y, p, (mp_rnd_t) r, trint, inexact);
}
}
}
diff --git a/tests/tset.c b/tests/tset.c
index b4418eea3..47c7551a4 100644
--- a/tests/tset.c
+++ b/tests/tset.c
@@ -46,7 +46,7 @@ main (void)
{
mp_prec_t p, q;
mpfr_t x, y, z, u;
- mp_rnd_t rnd;
+ int rnd;
int inexact, cmp;
mp_exp_t emax;
@@ -119,7 +119,7 @@ main (void)
mpfr_set_prec (y, q);
for (rnd = 0; rnd < GMP_RND_MAX; rnd++)
{
- inexact = mpfr_set (y, x, rnd);
+ inexact = mpfr_set (y, x, (mp_rnd_t) rnd);
cmp = mpfr_cmp (y, x);
if (((inexact == 0) && (cmp != 0)) ||
((inexact > 0) && (cmp <= 0)) ||
diff --git a/tests/tset_d.c b/tests/tset_d.c
index 0f096e30a..520c10d06 100644
--- a/tests/tset_d.c
+++ b/tests/tset_d.c
@@ -108,16 +108,17 @@ main (int argc, char *argv[])
exit (1);
}
- mpfr_init2(z, 32);
- mpfr_set_d(z, 1.0, 0);
+ mpfr_init2 (z, 32);
+ mpfr_set_d (z, 1.0, (mp_rnd_t) 0);
if (mpfr_cmp_ui (z, 1))
{
mpfr_print_binary (z); puts ("");
printf ("Error: 1.0 != 1.0\n");
exit (1);
}
- mpfr_set_prec(x, 53); mpfr_init2(y, 53);
- mpfr_set_d(x, d=-1.08007920352320089721e+150, 0);
+ mpfr_set_prec (x, 53);
+ mpfr_init2 (y, 53);
+ mpfr_set_d (x, d=-1.08007920352320089721e+150, (mp_rnd_t) 0);
if (mpfr_get_d1 (x) != d)
{
mpfr_print_binary (x); puts ("");
@@ -126,9 +127,9 @@ main (int argc, char *argv[])
exit (1);
}
- mpfr_set_d(x, 8.06294740693074521573e-310, 0);
+ mpfr_set_d (x, 8.06294740693074521573e-310, (mp_rnd_t) 0);
d = -6.72658901114033715233e-165;
- mpfr_set_d(x, d, 0);
+ mpfr_set_d (x, d, (mp_rnd_t) 0);
if (d != mpfr_get_d1 (x))
{
mpfr_print_binary (x);
@@ -149,7 +150,7 @@ main (int argc, char *argv[])
#else
while (ABS(d) < DBL_MIN);
#endif
- mpfr_set_d (x, d, 0);
+ mpfr_set_d (x, d, (mp_rnd_t) 0);
dd = mpfr_get_d1 (x);
if (d != dd && !(Isnan(d) && Isnan(dd)))
{
diff --git a/tests/tset_f.c b/tests/tset_f.c
index a92a47003..f0934ec8b 100644
--- a/tests/tset_f.c
+++ b/tests/tset_f.c
@@ -47,7 +47,7 @@ main (void)
mpfr_set_f (x, y, GMP_RNDN);
mpf_random2 (y, 10, 0);
- mpfr_set_f (x, y, RND_RAND() );
+ mpfr_set_f (x, y, (mp_rnd_t) RND_RAND());
/* bug found by Jean-Pierre Merlet */
mpfr_set_prec (x, 256);
@@ -93,25 +93,25 @@ main (void)
mpf_set_prec (z, pr);
mpf_random2 (z, z->_mp_prec, 0);
mpfr_set_prec (x, pr);
- mpfr_set_f (x, z, 0);
+ mpfr_set_f (x, z, (mp_rnd_t) 0);
}
/* Check for +0 */
mpfr_set_prec (x, 53);
mpf_set_prec (y, 53);
mpf_set_ui (y, 0);
- for(r = 0 ; r < GMP_RND_MAX ; r++)
+ for (r = 0 ; r < GMP_RND_MAX ; r++)
{
int i;
for (i = -1; i <= 1; i++)
{
if (i)
mpfr_set_si (x, i, GMP_RNDN);
- inexact = mpfr_set_f (x, y, r);
+ inexact = mpfr_set_f (x, y, (mp_rnd_t) r);
if (!MPFR_IS_ZERO(x) || !MPFR_IS_POS(x) || inexact)
{
printf ("mpfr_set_f(x,0) failed for %s, i = %d\n",
- mpfr_print_rnd_mode (r), i);
+ mpfr_print_rnd_mode ((mp_rnd_t) r), i);
exit (1);
}
}
diff --git a/tests/tset_ld.c b/tests/tset_ld.c
index e3de42851..c1fa390a1 100644
--- a/tests/tset_ld.c
+++ b/tests/tset_ld.c
@@ -58,13 +58,13 @@ Isnan_ld (long double d)
static void
check_set_get (long double d, mpfr_t x)
{
- mp_rnd_t r;
+ int r;
long double e;
int inex;
for (r = 0; r < GMP_RND_MAX; r++)
{
- inex = mpfr_set_ld (x, d, r);
+ inex = mpfr_set_ld (x, d, (mp_rnd_t) r);
if (inex != 0)
{
printf ("Error: mpfr_set_ld should be exact\n");
@@ -73,7 +73,7 @@ check_set_get (long double d, mpfr_t x)
mpfr_dump (x);
exit (1);
}
- e = mpfr_get_ld (x, r);
+ e = mpfr_get_ld (x, (mp_rnd_t) r);
if (e != d && !(Isnan_ld(e) && Isnan_ld(d)))
{
printf ("Error: mpfr_get_ld o mpfr_set_ld <> Id\n");
diff --git a/tests/tset_q.c b/tests/tset_q.c
index 6dc01bb77..e838b52ce 100644
--- a/tests/tset_q.c
+++ b/tests/tset_q.c
@@ -75,24 +75,24 @@ static void check0(void)
mpq_t y;
mpfr_t x;
int inexact;
- mp_rnd_t r;
+ int r;
/* Check for +0 */
- mpfr_init(x);
- mpq_init(y);
- mpq_set_si(y, 0, 1);
- for(r = 0 ; r < GMP_RND_MAX ; r++)
+ mpfr_init (x);
+ mpq_init (y);
+ mpq_set_si (y, 0, 1);
+ for (r = 0; r < GMP_RND_MAX; r++)
{
- inexact = mpfr_set_q(x, y, r);
+ inexact = mpfr_set_q(x, y, (mp_rnd_t) r);
if (!MPFR_IS_ZERO(x) || !MPFR_IS_POS(x) || inexact)
{
printf("mpfr_set_q(x,0) failed for %s\n",
- mpfr_print_rnd_mode(r));
+ mpfr_print_rnd_mode ((mp_rnd_t) r));
exit(1);
}
}
- mpfr_clear(x);
- mpq_clear(y);
+ mpfr_clear (x);
+ mpq_clear (y);
}
int
diff --git a/tests/tset_si.c b/tests/tset_si.c
index cdf514a6f..4d25e5b95 100644
--- a/tests/tset_si.c
+++ b/tests/tset_si.c
@@ -82,7 +82,7 @@ main (int argc, char *argv[])
long k, z, d, N;
unsigned long zl, dl;
int inex;
- mp_rnd_t r;
+ int r;
mp_exp_t emax;
tests_start_mpfr ();
@@ -177,23 +177,23 @@ main (int argc, char *argv[])
exit (1);
}
- for(r = 0 ; r < GMP_RND_MAX ; r++)
+ for (r = 0 ; r < GMP_RND_MAX ; r++)
{
- mpfr_set_si (x, -1, r);
- mpfr_set_ui (x, 0, r);
+ mpfr_set_si (x, -1, (mp_rnd_t) r);
+ mpfr_set_ui (x, 0, (mp_rnd_t) r);
if (MPFR_IS_NEG (x) )
{
printf ("mpfr_set_ui (x, 0) gives -0 for %s\n",
- mpfr_print_rnd_mode(r));
+ mpfr_print_rnd_mode ((mp_rnd_t) r));
exit (1);
}
- mpfr_set_si (x, -1, r);
- mpfr_set_si (x, 0, r);
- if (MPFR_IS_NEG (x) )
+ mpfr_set_si (x, -1, (mp_rnd_t) r);
+ mpfr_set_si (x, 0, (mp_rnd_t) r);
+ if (MPFR_IS_NEG (x))
{
printf ("mpfr_set_si (x, 0) gives -0 for %s\n",
- mpfr_print_rnd_mode(r) );
+ mpfr_print_rnd_mode ((mp_rnd_t) r));
exit (1);
}
}
diff --git a/tests/tset_str.c b/tests/tset_str.c
index be520eb07..95ba5dba4 100644
--- a/tests/tset_str.c
+++ b/tests/tset_str.c
@@ -111,7 +111,7 @@ main (int argc, char *argv[])
bd = randlimb () & 8;
- str2 = str = (*__gmp_allocate_func) (nc * sizeof(char));
+ str2 = str = (char*) (*__gmp_allocate_func) (nc * sizeof(char));
if (bd)
{
@@ -211,13 +211,13 @@ main (int argc, char *argv[])
baseprec = prec;
else
baseprec = 1 + (prec - 2 + logbase) / logbase;
- str = mpfr_get_str (NULL, &e, base, baseprec, x, k);
- mpfr_set_str (y, str, base, k);
+ str = mpfr_get_str (NULL, &e, base, baseprec, x, (mp_rnd_t) k);
+ mpfr_set_str (y, str, base, (mp_rnd_t) k);
MPFR_EXP(y) += logbase * (e - strlen (str));
if (mpfr_cmp (x, y))
{
printf ("mpfr_set_str o mpfr_get_str <> id for rnd_mode=%s\n",
- mpfr_print_rnd_mode (k));
+ mpfr_print_rnd_mode ((mp_rnd_t) k));
printf ("x=");
mpfr_print_binary (x);
puts ("");
@@ -743,7 +743,7 @@ main (int argc, char *argv[])
mpfr_set_prec (x, mp_bits_per_limb); /* x and y have only one limb */
mpfr_set_prec (y, mp_bits_per_limb);
- str = (*__gmp_allocate_func) (N + 20);
+ str = (char*) (*__gmp_allocate_func) (N + 20);
mpfr_set_ui (x, 1, GMP_RNDN); /* ensures that x is not NaN or Inf */
for (; nb_digit < N; nb_digit *= 10)
diff --git a/tests/tset_z.c b/tests/tset_z.c
index f733b4f40..3bb53e7f1 100644
--- a/tests/tset_z.c
+++ b/tests/tset_z.c
@@ -31,17 +31,18 @@ static void check0(void)
mpz_t y;
mpfr_t x;
int inexact, r;
+
/* Check for +0 */
- mpfr_init(x);
- mpz_init(y);
- mpz_set_si(y, 0);
- for(r = 0 ; r < GMP_RND_MAX ; r++)
+ mpfr_init (x);
+ mpz_init (y);
+ mpz_set_si (y, 0);
+ for(r = 0; r < GMP_RND_MAX; r++)
{
- inexact = mpfr_set_z(x, y, r);
+ inexact = mpfr_set_z (x, y, (mp_rnd_t) r);
if (!MPFR_IS_ZERO(x) || !MPFR_IS_POS(x) || inexact)
{
printf("mpfr_set_z(x,0) failed for %s\n",
- mpfr_print_rnd_mode(r));
+ mpfr_print_rnd_mode ((mp_rnd_t) r));
exit(1);
}
}
@@ -129,11 +130,12 @@ main (int argc, char *argv[])
tests_start_mpfr ();
check_large ();
- check (0, 0);
+ check (0, (mp_rnd_t) 0);
for (j = 0; j < 200000; j++)
- check (randlimb () & LONG_MAX, RND_RAND () );
- check0();
+ check (randlimb () & LONG_MAX, (mp_rnd_t) RND_RAND ());
+ check0 ();
tests_end_mpfr ();
+
return 0;
}
diff --git a/tests/tsqr.c b/tests/tsqr.c
index 9a28be720..7036ab28b 100644
--- a/tests/tsqr.c
+++ b/tests/tsqr.c
@@ -72,7 +72,7 @@ error2 (mp_rnd_t rnd, mpfr_prec_t prec, mpfr_t in, mpfr_t out,
void check_random(mpfr_prec_t p)
{
mpfr_t x,y,z;
- mp_rnd_t r;
+ int r;
int i, inexact1, inexact2;
mpfr_inits2(p, x, y, z, NULL);
@@ -80,14 +80,14 @@ void check_random(mpfr_prec_t p)
{
mpfr_random (x);
if (MPFR_IS_PURE_FP(x))
- for(r = 0 ; r < GMP_RND_MAX ; r++)
+ for (r = 0 ; r < GMP_RND_MAX ; r++)
{
- inexact1 = mpfr_mul (y, x, x, r);
- inexact2 = mpfr_sqr (z, x, r);
- if (mpfr_cmp(y, z))
- error1 (r,p,x,y,z);
+ inexact1 = mpfr_mul (y, x, x, (mp_rnd_t) r);
+ inexact2 = mpfr_sqr (z, x, (mp_rnd_t) r);
+ if (mpfr_cmp (y, z))
+ error1 ((mp_rnd_t) r,p,x,y,z);
if (inexact_sign (inexact1) != inexact_sign (inexact2))
- error2 (r,p,x,y,inexact1,inexact2);
+ error2 ((mp_rnd_t) r,p,x,y,inexact1,inexact2);
}
}
mpfr_clears(x,y,z,NULL);
diff --git a/tests/tsqrt.c b/tests/tsqrt.c
index 5419b9923..0af702ea8 100644
--- a/tests/tsqrt.c
+++ b/tests/tsqrt.c
@@ -379,7 +379,7 @@ check_inexact (mp_prec_t p)
mpfr_init2 (y, p);
mpfr_init2 (z, 2*p);
mpfr_random (x);
- rnd = RND_RAND();
+ rnd = (mp_rnd_t) RND_RAND();
inexact = mpfr_sqrt (y, x, rnd);
if (mpfr_mul (z, y, y, rnd)) /* exact since prec(z) = 2*prec(y) */
{
diff --git a/tests/tsub.c b/tests/tsub.c
index 9d5430beb..9382949b8 100644
--- a/tests/tsub.c
+++ b/tests/tsub.c
@@ -411,14 +411,14 @@ check_inexact (void)
: MPFR_EXP(u) - MPFR_EXP(x);
pz = pz + MAX(MPFR_PREC(x), MPFR_PREC(u));
mpfr_set_prec (z, pz);
- rnd = RND_RAND();
+ rnd = (mp_rnd_t) RND_RAND();
if (mpfr_sub (z, x, u, rnd))
{
printf ("z <- x - u should be exact\n");
exit (1);
}
{
- rnd = RND_RAND ();
+ rnd = (mp_rnd_t) RND_RAND ();
inexact = mpfr_sub (y, x, u, rnd);
cmp = mpfr_cmp (y, z);
if (((inexact == 0) && (cmp != 0)) ||
diff --git a/tests/tsub1sp.c b/tests/tsub1sp.c
index 1dcc476be..f717cd720 100644
--- a/tests/tsub1sp.c
+++ b/tests/tsub1sp.c
@@ -44,7 +44,7 @@ int main(void)
#define STD_ERROR \
{\
printf("ERROR: for %s and p=%lu and i=%d:\nY=",\
- mpfr_print_rnd_mode(r), p, i);\
+ mpfr_print_rnd_mode ((mp_rnd_t) r), p, i);\
mpfr_print_binary(y);\
printf("\nZ="); mpfr_print_binary(z);\
printf("\nReal: "); mpfr_print_binary(x2);\
@@ -56,7 +56,7 @@ int main(void)
#define STD_ERROR2 \
{\
printf("ERROR: for %s and p=%lu and i=%d:\nY=",\
- mpfr_print_rnd_mode(r), p, i);\
+ mpfr_print_rnd_mode ((mp_rnd_t) r), p, i);\
mpfr_print_binary(y);\
printf("\nZ="); mpfr_print_binary(z);\
printf("\nR="); mpfr_print_binary(x);\
@@ -68,7 +68,7 @@ int main(void)
void check_random(mpfr_prec_t p)
{
mpfr_t x,y,z,x2;
- mp_rnd_t r;
+ int r;
int i, inexact1, inexact2;
mpfr_inits2(p, x,y,z,x2,NULL);
@@ -80,8 +80,8 @@ void check_random(mpfr_prec_t p)
if (MPFR_IS_PURE_FP(y) && MPFR_IS_PURE_FP(z))
for(r = 0 ; r < GMP_RND_MAX ; r++)
{
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -95,7 +95,7 @@ void check_random(mpfr_prec_t p)
void check_special(void)
{
mpfr_t x,y,z,x2;
- mp_rnd_t r;
+ int r;
mpfr_prec_t p;
int i = -1, inexact1, inexact2;
mp_exp_t es;
@@ -113,7 +113,7 @@ void check_special(void)
mpfr_set_str_binary (y,
"0.10110111101101110010010010011011000001101101011011001E31");
- mpfr_sub1sp(x, y, y, r);
+ mpfr_sub1sp (x, y, y, (mp_rnd_t) r);
if (mpfr_cmp_ui(x, 0))
{
printf("Error for x-x with p=%lu. Expected 0. Got:", p);
@@ -121,8 +121,8 @@ void check_special(void)
exit(1);
}
- mpfr_set(z, y, r);
- mpfr_sub1sp(x, y, z, r);
+ mpfr_set(z, y, (mp_rnd_t) r);
+ mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp_ui(x, 0))
{
printf("Error for x-y with y=x and p=%lu. Expected 0. Got:", p);
@@ -132,8 +132,8 @@ void check_special(void)
/* diff = 0 */
mpfr_set_str_binary (y,
"0.10110111101101110010010010011011001001101101011011001E31");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -142,8 +142,8 @@ void check_special(void)
/* Diff = 1 */
mpfr_set_str_binary (y,
"0.10110111101101110010010010011011000001101101011011001E30");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -152,8 +152,8 @@ void check_special(void)
/* Diff = 2 */
mpfr_set_str_binary (y,
"0.10110111101101110010010010011011000101101101011011001E32");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -162,8 +162,8 @@ void check_special(void)
/* Diff = 32 */
mpfr_set_str_binary (y,
"0.10110111101101110010010010011011000001101101011011001E63");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -172,8 +172,8 @@ void check_special(void)
/* Diff = 52 */
mpfr_set_str_binary (y,
"0.10110111101101110010010010011011010001101101011011001E83");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -182,8 +182,8 @@ void check_special(void)
/* Diff = 53 */
mpfr_set_str_binary (y,
"0.10110111101101110010010010011111000001101101011011001E31");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -192,8 +192,8 @@ void check_special(void)
/* Diff > 200 */
mpfr_set_str_binary (y,
"0.10110111101101110010010010011011000001101101011011001E331");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -203,8 +203,8 @@ void check_special(void)
"0.10000000000000000000000000000000000000000000000000000E31");
mpfr_set_str_binary (z,
"0.11111111111111111111111111111111111111111111111111111E30");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -214,8 +214,8 @@ void check_special(void)
"0.10000000000000000000000000000000000000000000000000000E31");
mpfr_set_str_binary (z,
"0.11111111111111111111111111111111111111111111111111111E29");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -225,8 +225,8 @@ void check_special(void)
"0.10000000000000000000000000000000000000000000000000000E52");
mpfr_set_str_binary (z,
"0.10000000000010000000000000000000000000000000000000000E00");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -236,9 +236,9 @@ void check_special(void)
"0.11100000000000000000000000000000000000000000000000000E53");
mpfr_set_str_binary (z,
"0.10000000000000000000000000000000000000000000000000000E00");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(z, y, z, r);
- mpfr_set(x, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(z, y, z, (mp_rnd_t) r);
+ mpfr_set(x, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -248,8 +248,8 @@ void check_special(void)
"0.10000000000000000000000000000000000000000000000000000E53");
mpfr_set_str_binary (z,
"0.10100000000000000000000000000000000000000000000000000E00");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -259,8 +259,8 @@ void check_special(void)
"0.10000000000000000000000000000000000000000000000000000E54");
mpfr_set_str_binary (z,
"0.10100000000000000000000000000000000000000000000000000E00");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -275,8 +275,8 @@ void check_special(void)
"0.100000000000000000000000000000000000000000000000000000000000000E62");
mpfr_set_str_binary (z,
"0.110000000000000000000000000000000000000000000000000000000000000E00");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -292,8 +292,8 @@ void check_special(void)
"0.1100000000000000000000000000000000000000000000000000000000000000E31");
mpfr_set_str_binary (z,
"0.1111111111111111111111111110000000000000000000000000011111111111E29");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -303,8 +303,8 @@ void check_special(void)
"0.1000000000000000000000000000000000000000000000000000000000000000E63");
mpfr_set_str_binary (z,
"0.1011000000000000000000000000000000000000000000000000000000000000E00");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -314,8 +314,8 @@ void check_special(void)
"0.1000000000000000000000000000000000000000000000000000000000000000E63");
mpfr_set_str_binary (z,
"0.1110000000000000000000000000000000000000000000000000000000000000E00");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -325,8 +325,8 @@ void check_special(void)
"0.10000000000000000000000000000000000000000000000000000000000000E63");
mpfr_set_str_binary (z,
"0.10000000000000000000000000000000000000000000000000000000000000E00");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -336,8 +336,8 @@ void check_special(void)
"0.1000000000000000000000000000000000000000000000000000000000000000E64");
mpfr_set_str_binary (z,
"0.1010000000000000000000000000000000000000000000000000000000000000E00");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -351,8 +351,8 @@ void check_special(void)
mpfr_set_str_binary (z,
"0.1100000000000000000000000000000000000000000000000000000000000000"
"E-1073741823");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -366,8 +366,8 @@ void check_special(void)
mpfr_set_str_binary (y, "0.100000000E1");
mpfr_set_str_binary (z, "0.100000000E-8");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -381,8 +381,8 @@ void check_special(void)
mpfr_set_str_binary (y, "-0.1011110000111100010111011100110100E-18");
mpfr_set_str_binary (z, "0.1000101010110011010101011110000000E-14");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -398,8 +398,8 @@ void check_special(void)
"0.1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E1");
mpfr_set_str_binary (z,
"0.1011111000100111000011001000011101010101101100101010101001000001110100001101110110001110111010000011101001100010111110001100E-31");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -415,8 +415,8 @@ void check_special(void)
"0.111000110011000001000111101010111011110011101001101111111110000011100101000001001010110010101010011001010100000001110011110001010101101010001011101110100100001011110100110000101101100011010001001011011010101010000010001101001000110010010111111011110001111101001000101101001100101100101000E80");
mpfr_set_str_binary (z,
"-0.100001111111101001011010001100110010100111001110000110011101001011010100001000000100111011010110110010000000000010101101011000010000110001110010100001100101011100100100001011000100011110000001010101000100011101001000010111100000111000111011001000100100011000100000010010111000000100100111E-258");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -432,8 +432,8 @@ void check_special(void)
"0.1111101110100110110110100010101011101001100010100011110110110010010011101100101111100E-4");
mpfr_set_str_binary (z,
"0.1111101110100110110110100010101001001000011000111000011101100101110100001110101010110E-4");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -449,8 +449,8 @@ void check_special(void)
mpfr_set_str_binary (z,
"0.10000000000000000000000000000000"
"00000000000000000000000000000001E0");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -462,8 +462,8 @@ void check_special(void)
mpfr_set_str_binary (z,
"0.10000000000000000000000000000000"
"00000000000000000000000000000001E0");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -478,8 +478,8 @@ void check_special(void)
mpfr_set_str_binary (z,
"0.10000000000000000000000000000000"
"00000000000000000000000000000001E-1023");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
@@ -491,8 +491,8 @@ void check_special(void)
mpfr_set_str_binary (z,
"0.1000000000000000000000000000000"
"000000000000000000000000000000E-1023");
- inexact1 = mpfr_sub1(x2, y, z, r);
- inexact2 = mpfr_sub1sp(x, y, z, r);
+ inexact1 = mpfr_sub1(x2, y, z, (mp_rnd_t) r);
+ inexact2 = mpfr_sub1sp(x, y, z, (mp_rnd_t) r);
if (mpfr_cmp(x, x2))
STD_ERROR;
if (inexact1 != inexact2)
diff --git a/tests/tsum.c b/tests/tsum.c
index 058ae9aff..739768631 100644
--- a/tests/tsum.c
+++ b/tests/tsum.c
@@ -100,7 +100,7 @@ main (void)
mpfr_ptr *tabtmp;
unsigned long i, n;
mp_prec_t f;
- mp_rnd_t rnd_mode;
+ int rnd_mode;
mpfr_srcptr *perm;
mpfr_t sum, real_sum, real_non_rounded;
@@ -118,8 +118,8 @@ main (void)
algo_exact (real_non_rounded, tab, n, f);
for (rnd_mode = 0; rnd_mode < GMP_RND_MAX; rnd_mode++)
{
- mpfr_list_sum (sum, tab, n, rnd_mode);
- mpfr_set (real_sum, real_non_rounded, rnd_mode);
+ mpfr_list_sum (sum, tab, n, (mp_rnd_t) rnd_mode);
+ mpfr_set (real_sum, real_non_rounded, (mp_rnd_t) rnd_mode);
if (mpfr_cmp (real_sum, sum) != 0)
{
printf ("mpfr_list_sum incorrect.\n");
@@ -142,8 +142,8 @@ main (void)
for (rnd_mode = 0; rnd_mode < GMP_RND_MAX; rnd_mode++)
{
- mpfr_list_sum (sum, tab, n, rnd_mode);
- mpfr_set (real_sum, real_non_rounded, rnd_mode);
+ mpfr_list_sum (sum, tab, n, (mp_rnd_t) rnd_mode);
+ mpfr_set (real_sum, real_non_rounded, (mp_rnd_t) rnd_mode);
if (mpfr_cmp (real_sum, sum) != 0)
{
printf ("mpfr_list_sum incorrect.\n");
diff --git a/tests/tui_div.c b/tests/tui_div.c
index ed2777442..095d2911c 100644
--- a/tests/tui_div.c
+++ b/tests/tui_div.c
@@ -51,7 +51,7 @@ check_inexact (void)
mp_prec_t px, py;
int inexact, cmp;
unsigned long int u;
- mp_rnd_t rnd;
+ int rnd;
mpfr_init (x);
mpfr_init (y);
@@ -72,8 +72,8 @@ check_inexact (void)
mpfr_set_prec (z, py + px);
for (rnd = 0; rnd < GMP_RND_MAX; rnd++)
{
- inexact = mpfr_ui_div (y, u, x, rnd);
- if (mpfr_mul (z, y, x, rnd))
+ inexact = mpfr_ui_div (y, u, x, (mp_rnd_t) rnd);
+ if (mpfr_mul (z, y, x, (mp_rnd_t) rnd))
{
printf ("z <- y * x should be exact\n");
exit (1);
@@ -84,7 +84,7 @@ check_inexact (void)
((inexact < 0) && (cmp >= 0)))
{
printf ("Wrong inexact flag for u=%lu, rnd=%s\n",
- u, mpfr_print_rnd_mode (rnd));
+ u, mpfr_print_rnd_mode ((mp_rnd_t) rnd));
printf ("expected %d, got %d\n", cmp, inexact);
printf ("x="); mpfr_print_binary (x); puts ("");
printf ("y="); mpfr_print_binary (y); puts ("");
diff --git a/tests/tui_pow.c b/tests/tui_pow.c
index 90c664ecc..d6c3f938f 100644
--- a/tests/tui_pow.c
+++ b/tests/tui_pow.c
@@ -238,7 +238,7 @@ main (int argc, char *argv[])
int nt;
nt = randlimb () & INT_MAX;
mpfr_random (x);
- rnd = RND_RAND ();
+ rnd = (mp_rnd_t) RND_RAND ();
check1 (x, prec, nt, rnd);
}
}
diff --git a/tests/tzeta.c b/tests/tzeta.c
index 1519b26c0..c183207b8 100644
--- a/tests/tzeta.c
+++ b/tests/tzeta.c
@@ -215,7 +215,7 @@ main (int argc, char *argv[])
mpfr_init2 (s, prec);
mpfr_init2 (z, prec);
mpfr_set_str (s, argv[1], 10, GMP_RNDN);
- rnd_mode = atoi(argv[3]);
+ rnd_mode = (mp_rnd_t) atoi(argv[3]);
mpfr_zeta (z, s, rnd_mode);
mpfr_out_str (stdout, 10, 0, z, GMP_RNDN);