summaryrefslogtreecommitdiff
path: root/tests/tsub.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2016-07-22 14:43:55 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2016-07-22 14:43:55 +0000
commitfa06e09eddd04e5c23a47b10b7add0c09093e576 (patch)
tree7b03737745bf6968f12b54f8f255f9738969d8ab /tests/tsub.c
parent31b27e688bf029b0115f8afe0b04c50cfd86f4de (diff)
downloadmpfr-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/tsub.c')
-rw-r--r--tests/tsub.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/tests/tsub.c b/tests/tsub.c
index 341ad4c6a..f008907ba 100644
--- a/tests/tsub.c
+++ b/tests/tsub.c
@@ -443,16 +443,14 @@ check_inexact (void)
: MPFR_EXP(u) - MPFR_EXP(x);
pz = pz + MAX(MPFR_PREC(x), MPFR_PREC(u));
mpfr_set_prec (z, pz);
- /* for RNDF, inexact makes no sense */
- do rnd = RND_RAND (); while (rnd == MPFR_RNDF);
+ rnd = RND_RAND_NO_RNDF ();
if (test_sub (z, x, u, rnd))
{
printf ("z <- x - u should be exact\n");
exit (1);
}
{
- /* for RNDF, inexact makes no sense */
- do rnd = RND_RAND (); while (rnd == MPFR_RNDF);
+ rnd = RND_RAND_NO_RNDF ();
inexact = test_sub (y, x, u, rnd);
cmp = mpfr_cmp (y, z);
if (((inexact == 0) && (cmp != 0)) ||
@@ -685,14 +683,11 @@ check_max_almosteven (void)
for (j = 1; j >= 0; j--)
{
mpfr_set_exp (b, __gmpfr_emax - j);
- RND_LOOP (rnd)
+ RND_LOOP_NO_RNDF (rnd)
{
mpfr_flags_t flags1, flags2;
int inex1, inex2;
- if (rnd == MPFR_RNDF)
- continue;
-
/* Expected result. */
flags1 = MPFR_FLAGS_INEXACT;
if (rnd == MPFR_RNDN || MPFR_IS_LIKE_RNDZ (rnd, neg))