diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2019-02-04 14:17:56 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2019-02-04 14:17:56 +0000 |
commit | c3a36415a7440110cb47a3ea314fc55e00adb7f9 (patch) | |
tree | 4dd0267276967ea744c49680c5fe10a42fb634cd /tests/tset_float128.c | |
parent | a0b24fa20c70b60a3ef7d8ed4af64a9a666857b2 (diff) | |
download | mpfr-c3a36415a7440110cb47a3ea314fc55e00adb7f9.tar.gz |
[tests] Use MPFR_DBL_* macros when necessary.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13446 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tset_float128.c')
-rw-r--r-- | tests/tset_float128.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/tset_float128.c b/tests/tset_float128.c index 5c3179cfa..95fd936dd 100644 --- a/tests/tset_float128.c +++ b/tests/tset_float128.c @@ -28,6 +28,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #ifdef MPFR_WANT_FLOAT128 #include "mpfr-test.h" +#include "ieee_floats.h" static void check_special (void) @@ -39,7 +40,7 @@ check_special (void) #if !defined(MPFR_ERRDIVZERO) /* check NaN */ - f = 0.0 / 0.0; + f = MPFR_DBL_NAN; mpfr_set_float128 (x, f, MPFR_RNDN); if (! mpfr_nan_p (x)) { @@ -55,7 +56,7 @@ check_special (void) } /* check +Inf */ - f = 1.0 / 0.0; + f = MPFR_DBL_INFP; mpfr_set_float128 (x, f, MPFR_RNDN); if (! mpfr_inf_p (x) || MPFR_IS_NEG (x)) { @@ -63,14 +64,14 @@ check_special (void) exit (1); } f = mpfr_get_float128 (x, MPFR_RNDN); - if (f != (1.0 / 0.0)) + if (f != MPFR_DBL_INFP) { printf ("Error in mpfr_get_float128(+Inf)\n"); exit (1); } /* check -Inf */ - f = -1.0 / 0.0; + f = MPFR_DBL_INFM; mpfr_set_float128 (x, f, MPFR_RNDN); if (! mpfr_inf_p (x) || MPFR_IS_POS (x)) { @@ -78,7 +79,7 @@ check_special (void) exit (1); } f = mpfr_get_float128 (x, MPFR_RNDN); - if (f != (-1.0 / 0.0)) + if (f != MPFR_DBL_INFM) { printf ("Error in mpfr_get_float128(-Inf)\n"); exit (1); @@ -100,7 +101,7 @@ check_special (void) exit (1); } #if !defined(MPFR_ERRDIVZERO) && defined(HAVE_SIGNEDZ) - if (1 / f != 1 / 0.0) /* check the sign */ + if (1 / f != MPFR_DBL_INFP) /* check the sign */ { printf ("Error in mpfr_get_float128(+0.0)\n"); exit (1); @@ -129,7 +130,7 @@ check_special (void) exit (1); } #if !defined(MPFR_ERRDIVZERO) && defined(HAVE_SIGNEDZ) - if (1 / f != 1 / -0.0) /* check the sign */ + if (1 / f != MPFR_DBL_INFM) /* check the sign */ { printf ("Error in mpfr_get_float128(-0.0)\n"); exit (1); |