summaryrefslogtreecommitdiff
path: root/tests/tabs.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2002-03-19 16:44:32 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2002-03-19 16:44:32 +0000
commit7f5910d6d74a6df6cdfe4e054daf146b2741eb8f (patch)
treeb599758d3a523f224d6f70c80befaf4a3733f31d /tests/tabs.c
parent5e312be811d30870960160d99704344f5f6a6933 (diff)
downloadmpfr-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/tabs.c')
-rw-r--r--tests/tabs.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/tests/tabs.c b/tests/tabs.c
index bf5964d1e..736c2335f 100644
--- a/tests/tabs.c
+++ b/tests/tabs.c
@@ -25,8 +25,6 @@ MA 02111-1307, USA. */
#include "mpfr.h"
#include "mpfr-test.h"
-#define Infp (1/0.)
-
void check_inexact _PROTO((void));
void
@@ -107,18 +105,21 @@ main (int argc, char *argv[])
fprintf(stderr, "Error in mpfr_abs(-1.0)\n"); exit(1);
}
- mpfr_set_d(x, -6/-0., GMP_RNDN);
- mpfr_abs(x, x, GMP_RNDN);
- if (mpfr_get_d(x) != Infp) {
- fprintf(stderr, "Error in mpfr_abs(Inf).\n"); exit(1);
- }
-
- mpfr_set_d(x, 2/-0., GMP_RNDN);
- mpfr_abs(x, x, GMP_RNDN);
- if (mpfr_get_d(x) != Infp) {
- fprintf(stderr, "Error in mpfr_abs(-Inf).\n"); exit(1);
- }
+ mpfr_set_d (x, -6/-0., GMP_RNDN);
+ mpfr_abs (x, x, GMP_RNDN);
+ if (!mpfr_inf_p(x) || (mpfr_sgn(x) <= 0))
+ {
+ fprintf (stderr, "Error in mpfr_abs(Inf).\n");
+ exit (1);
+ }
+ mpfr_set_d (x, 2/-0., GMP_RNDN);
+ mpfr_abs (x, x, GMP_RNDN);
+ if (!mpfr_inf_p(x) || (mpfr_sgn(x) <= 0))
+ {
+ fprintf (stderr, "Error in mpfr_abs(-Inf).\n");
+ exit (1);
+ }
n = (argc==1) ? 1000000 : atoi(argv[1]);
for (k = 1; k <= n; k++)