diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-07-22 14:43:55 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-07-22 14:43:55 +0000 |
commit | fa06e09eddd04e5c23a47b10b7add0c09093e576 (patch) | |
tree | 7b03737745bf6968f12b54f8f255f9738969d8ab /tests/tget_f.c | |
parent | 31b27e688bf029b0115f8afe0b04c50cfd86f4de (diff) | |
download | mpfr-fa06e09eddd04e5c23a47b10b7add0c09093e576.tar.gz |
[tests] Define the RND_RAND_NO_RNDF and RND_LOOP_NO_RNDF macros, similar
to RND_RAND and RND_LOOP respectively but excluding MPFR_RNDF, to be
used for tests that don't make sense in the faithful rounding mode.
Replaced code to use these macros, fixing the remaining failures.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/faithful@10656 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tget_f.c')
-rw-r--r-- | tests/tget_f.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/tests/tget_f.c b/tests/tget_f.c index b0af066c6..b73e2a503 100644 --- a/tests/tget_f.c +++ b/tests/tget_f.c @@ -185,13 +185,10 @@ ternary_test (void) /* y == 1 */ mpfr_set_ui_2exp (y, 1, prec, MPFR_RNDN); - RND_LOOP (rnd) + RND_LOOP_NO_RNDF (rnd) { inex = mpfr_get_f (x, y, (mpfr_rnd_t) rnd); - if (rnd == MPFR_RNDF) - continue; - if (inex != 0 || mpfr_cmp_f (y, x) != 0) { printf ("Error (1) in mpfr_get_f (x, y, %s)\nx = ", @@ -209,7 +206,7 @@ ternary_test (void) /* y == 1 + epsilon */ mpfr_nextbelow (y); - RND_LOOP (rnd) + RND_LOOP_NO_RNDF (rnd) { switch (rnd) { @@ -223,9 +220,6 @@ ternary_test (void) inex = mpfr_get_f (x, y, (mpfr_rnd_t) rnd); - if (rnd == MPFR_RNDF) - continue; - if (! SAME_SIGN (expected_inex, inex) || SAME_SIGN (expected_inex, mpfr_cmp_f (y, x))) { @@ -245,13 +239,10 @@ ternary_test (void) /* y == positive random float */ mpfr_random2 (y, MPFR_LIMB_SIZE (y), 1024, RANDS); - RND_LOOP (rnd) + RND_LOOP_NO_RNDF (rnd) { inex = mpfr_get_f (x, y, (mpfr_rnd_t) rnd); - if (rnd == MPFR_RNDF) - continue; - if (! SAME_SIGN (inex, -mpfr_cmp_f (y, x))) { printf ("Error (3) in mpfr_get_f (x, y, %s)\nx = ", |