diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-03-19 16:44:32 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-03-19 16:44:32 +0000 |
commit | 7f5910d6d74a6df6cdfe4e054daf146b2741eb8f (patch) | |
tree | b599758d3a523f224d6f70c80befaf4a3733f31d /tests/tcmp.c | |
parent | 5e312be811d30870960160d99704344f5f6a6933 (diff) | |
download | mpfr-7f5910d6d74a6df6cdfe4e054daf146b2741eb8f.tar.gz |
now use macros DBL_NAN, DBL_POS_INF, DBL_NEG_INF,
and functions mpfr_set_nan, mpfr_set_inf
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1758 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tcmp.c')
-rw-r--r-- | tests/tcmp.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/tests/tcmp.c b/tests/tcmp.c index 637cfa517..3db356ae4 100644 --- a/tests/tcmp.c +++ b/tests/tcmp.c @@ -1,6 +1,6 @@ /* Test file for mpfr_cmp. -Copyright 1999, 2001 Free Software Foundation, Inc. +Copyright 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of the MPFR Library. @@ -27,9 +27,6 @@ MA 02111-1307, USA. */ #include "mpfr-impl.h" #include "mpfr-test.h" -#define Infp 1/0. -#define Infm -1/0. - int main (void) { @@ -103,7 +100,7 @@ main (void) exit(1); } - mpfr_set_d(xx, Infp, GMP_RNDN); + mpfr_set_inf (xx, 1); mpfr_set_d(yy, -23489745.0329, GMP_RNDN); if (mpfr_cmp(xx, yy) <= 0) { fprintf(stderr, @@ -111,39 +108,39 @@ main (void) exit(1); } - mpfr_set_d(xx, Infp, GMP_RNDN); - mpfr_set_d(yy, Infm, GMP_RNDN); + mpfr_set_inf (xx, 1); + mpfr_set_inf (yy, -1); if (mpfr_cmp(xx, yy) <= 0) { fprintf(stderr, "Error in mpfr_cmp(Infp, Infm), gives %d\n", mpfr_cmp(xx, yy)); exit(1); } - mpfr_set_d(xx, Infm, GMP_RNDN); - mpfr_set_d(yy, Infp, GMP_RNDN); + mpfr_set_inf (xx, -1); + mpfr_set_inf (yy, 1); if (mpfr_cmp(xx, yy) >= 0) { fprintf(stderr, "Error in mpfr_cmp(Infm, Infp), gives %d\n", mpfr_cmp(xx, yy)); exit(1); } - mpfr_set_d(xx, Infp, GMP_RNDN); - mpfr_set_d(yy, Infp, GMP_RNDN); + mpfr_set_inf (xx, 1); + mpfr_set_inf (yy, 1); if (mpfr_cmp(xx, yy) != 0) { fprintf(stderr, "Error in mpfr_cmp(Infp, Infp), gives %d\n", mpfr_cmp(xx, yy)); exit(1); } - mpfr_set_d(xx, Infm, GMP_RNDN); - mpfr_set_d(yy, Infm, GMP_RNDN); + mpfr_set_inf (xx, -1); + mpfr_set_inf (yy, -1); if (mpfr_cmp(xx, yy) != 0) { fprintf(stderr, "Error in mpfr_cmp(Infm, Infm), gives %d\n", mpfr_cmp(xx, yy)); exit(1); } - mpfr_set_d(xx, Infm, GMP_RNDN); + mpfr_set_inf (xx, -1); mpfr_set_d(yy, 2346.09234, GMP_RNDN); if (mpfr_cmp(xx, yy) >= 0) { fprintf(stderr, |