diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2019-02-06 09:10:34 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2019-02-06 09:10:34 +0000 |
commit | 7e408afc43bc53101409ebfc94d1f00fe0723f77 (patch) | |
tree | e28c48e44a5ac6128b8be9d59cfc2fd1c712f2a9 /tests/tset_float128.c | |
parent | a586834d788017fc9d4106dd27c7c9bfb77c5f86 (diff) | |
download | mpfr-7e408afc43bc53101409ebfc94d1f00fe0723f77.tar.gz |
[tests] Use MPFR_DBL_* macros when necessary.
(merged changeset r13446 from the trunk)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/4.0@13449 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 01580cb2a..3a13a2e58 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); |