diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2005-01-27 10:56:44 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2005-01-27 10:56:44 +0000 |
commit | 6e38fda01d42c61db41a5c3b1091316436c70aee (patch) | |
tree | 54d04116f8dce35dd99e0e0588eeb79a9150f7bd /tests/texceptions.c | |
parent | b365c7af309a36559062b9ebea82776ebfd3a103 (diff) | |
download | mpfr-6e38fda01d42c61db41a5c3b1091316436c70aee.tar.gz |
casts to allow compilation with g++
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3221 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/texceptions.c')
-rw-r--r-- | tests/texceptions.c | 23 |
1 files changed, 12 insertions, 11 deletions
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); |