From 6e38fda01d42c61db41a5c3b1091316436c70aee Mon Sep 17 00:00:00 2001 From: zimmerma Date: Thu, 27 Jan 2005 10:56:44 +0000 Subject: casts to allow compilation with g++ git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3221 280ebfd0-de03-0410-8827-d642c229c3f4 --- tests/tatan.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'tests/tatan.c') 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); } } -- cgit v1.2.1