From 395b421e54deae9df55b533e396f3ba89fd49a1d Mon Sep 17 00:00:00 2001 From: vlefevre Date: Mon, 29 May 2017 16:11:10 +0000 Subject: [tests/tgeneric.c] For MPFR_RNDF, replaced EQUAL() by SAME_VAL(), which also tests the sign (to distinguish +0 and -0). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/faithful@11545 280ebfd0-de03-0410-8827-d642c229c3f4 --- tests/tgeneric.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tests/tgeneric.c b/tests/tgeneric.c index 751366dc0..31f5df72b 100644 --- a/tests/tgeneric.c +++ b/tests/tgeneric.c @@ -142,11 +142,6 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #define REDUCE_EMIN mpfr_get_emin () #endif -/* return non-zero if: - (1) either x and y are not NaN and are equal - (2) x = y = NaN */ -#define EQUAL(x,y) ((mpfr_nan_p (x) && mpfr_nan_p (y)) || mpfr_equal_p (x, y)) - static void test_generic (mpfr_prec_t p0, mpfr_prec_t p1, unsigned int nmax) { @@ -358,7 +353,6 @@ test_generic (mpfr_prec_t p0, mpfr_prec_t p1, unsigned int nmax) RNDD or RNDU. */ if (rnd == MPFR_RNDF) { - int ok; #if defined(TWO_ARGS) TEST_FUNCTION (yd, x, u, MPFR_RNDD); TEST_FUNCTION (yu, x, u, MPFR_RNDU); @@ -385,8 +379,7 @@ test_generic (mpfr_prec_t p0, mpfr_prec_t p1, unsigned int nmax) TEST_FUNCTION (yd, x, MPFR_RNDD); TEST_FUNCTION (yu, x, MPFR_RNDU); #endif - ok = EQUAL (y, yd) || EQUAL (y, yu); - if (ok == 0) + if (! (SAME_VAL (y, yd) || SAME_VAL (y, yu))) { printf ("For RNDF, result does not match RNDD nor RNDU\n"); printf ("x = "); mpfr_dump (x); -- cgit v1.2.1