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/trint.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/trint.c')
-rw-r--r-- | tests/trint.c | 24 |
1 files changed, 12 insertions, 12 deletions
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); } } } |