summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2002-04-09 10:50:01 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2002-04-09 10:50:01 +0000
commitdcdcf769be0708bfa7049eb4f231857106d2760b (patch)
tree847eb063355c76ff4db4847f7572a136cb0a1cdb /tests
parent28e9168b4e43066af45ddc3a11ad2f955214a61a (diff)
downloadmpfr-dcdcf769be0708bfa7049eb4f231857106d2760b.tar.gz
Check for fenv.h -> check for fesetround.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1833 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests')
-rw-r--r--tests/tadd.c10
-rw-r--r--tests/tadd_ui.c4
-rw-r--r--tests/tagm.c2
-rw-r--r--tests/tdiv.c6
-rw-r--r--tests/tdiv_ui.c4
-rw-r--r--tests/texp.c6
-rw-r--r--tests/tget_d.c2
-rw-r--r--tests/tget_str.c4
-rw-r--r--tests/tlog.c2
-rw-r--r--tests/tmul.c6
-rw-r--r--tests/tset_q.c4
-rw-r--r--tests/tsqrt.c4
-rw-r--r--tests/tsqrt_ui.c4
-rw-r--r--tests/tsub_ui.c4
-rw-r--r--tests/tui_div.c4
-rw-r--r--tests/tui_sub.c4
16 files changed, 35 insertions, 35 deletions
diff --git a/tests/tadd.c b/tests/tadd.c
index 546483127..25d35b4fd 100644
--- a/tests/tadd.c
+++ b/tests/tadd.c
@@ -56,7 +56,7 @@ check (double x, double y, mp_rnd_t rnd_mode, unsigned int px,
mpfr_set_d(xx, x, rnd_mode);
mpfr_set_d(yy, y, rnd_mode);
mpfr_add(zz, xx, yy, rnd_mode);
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
mpfr_set_machine_rnd_mode(rnd_mode);
if (px==53 && py==53 && pz==53) cert=1;
#endif
@@ -84,7 +84,7 @@ checknan (double x, double y, mp_rnd_t rnd_mode, unsigned int px,
mpfr_set_d(xx, x, rnd_mode);
mpfr_set_d(yy, y, rnd_mode);
mpfr_add(zz, xx, yy, rnd_mode);
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
mpfr_set_machine_rnd_mode(rnd_mode);
#endif
if (MPFR_IS_NAN(zz) == 0) { printf("Error, not an MPFR_NAN for xx = %1.20e, y = %1.20e\n", x, y); exit(1); }
@@ -94,7 +94,7 @@ checknan (double x, double y, mp_rnd_t rnd_mode, unsigned int px,
mpfr_clear(xx); mpfr_clear(yy); mpfr_clear(zz);
}
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
/* idem than check for mpfr_add(x, x, y) */
void
check3 (double x, double y, mp_rnd_t rnd_mode)
@@ -640,7 +640,7 @@ check_inexact (void)
int
main (int argc, char *argv[])
{
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
int prec, rnd_mode;
int rnd;
double y;
@@ -835,7 +835,7 @@ main (int argc, char *argv[])
check53(9007199254740994.0, -1.0, GMP_RNDN, 9007199254740992.0);
check53(9007199254740996.0, -1.0, GMP_RNDN, 9007199254740996.0);
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
prec = (argc<2) ? 53 : atoi(argv[1]);
rnd_mode = (argc<3) ? -1 : atoi(argv[2]);
/* Comparing to double precision using machine arithmetic */
diff --git a/tests/tadd_ui.c b/tests/tadd_ui.c
index 2321d2586..45c9d3eff 100644
--- a/tests/tadd_ui.c
+++ b/tests/tadd_ui.c
@@ -47,7 +47,7 @@ check3 (double x, unsigned long y, unsigned int rnd_mode, double z1)
mpfr_init2(zz, 53);
mpfr_set_d(xx, x, rnd_mode);
mpfr_add_ui(zz, xx, y, rnd_mode);
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
mpfr_set_machine_rnd_mode(rnd_mode);
#endif
if (z1==0.0) z1 = x+y;
@@ -77,7 +77,7 @@ special (void)
int
main (int argc, char *argv[])
{
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
double x; unsigned long y, N; int i,rnd_mode,rnd;
mpfr_test_init ();
diff --git a/tests/tagm.c b/tests/tagm.c
index bacb15b4b..3e80b1491 100644
--- a/tests/tagm.c
+++ b/tests/tagm.c
@@ -89,7 +89,7 @@ check4 (double a, double b, mp_rnd_t rnd_mode, double res1)
mpfr_set_d(tb, b, rnd_mode);
mpfr_agm(tres, ta, tb, rnd_mode);
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
mpfr_set_machine_rnd_mode(rnd_mode);
#endif
diff --git a/tests/tdiv.c b/tests/tdiv.c
index c07c2a3eb..8438bbeb6 100644
--- a/tests/tdiv.c
+++ b/tests/tdiv.c
@@ -47,7 +47,7 @@ check4 (double N, double D, mp_rnd_t rnd_mode, int p, double Q)
mpfr_set_d(n, N, rnd_mode);
mpfr_set_d(d, D, rnd_mode);
mpfr_div(q, n, d, rnd_mode);
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
mpfr_set_machine_rnd_mode(rnd_mode);
#endif
if (Q==0.0) Q = N/D;
@@ -451,7 +451,7 @@ main (int argc, char *argv[])
{
mpfr_t x, y, z;
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
int N, i;
double n, d, e;
@@ -494,7 +494,7 @@ main (int argc, char *argv[])
check53(1.04636807108079349236e-189, 3.72295730823253012954e-292, GMP_RNDZ,
2.810583051186143125e102);
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
N = (argc>1) ? atoi(argv[1]) : 100000;
SEED_RAND (time(NULL));
for (i=0;i<N;i++)
diff --git a/tests/tdiv_ui.c b/tests/tdiv_ui.c
index addc350ab..3b6076f3d 100644
--- a/tests/tdiv_ui.c
+++ b/tests/tdiv_ui.c
@@ -37,7 +37,7 @@ check (double d, unsigned long u, mp_rnd_t rnd, double e)
double f;
mpfr_init2(x, 53); mpfr_init2(y, 53);
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
mpfr_set_machine_rnd_mode(rnd);
#endif
if (e==0.0) e = d / u;
@@ -174,7 +174,7 @@ int
main (int argc, char **argv)
{
mpfr_t x;
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
int i;
unsigned long u;
double d;
diff --git a/tests/texp.c b/tests/texp.c
index 333ff1904..2193a2dcb 100644
--- a/tests/texp.c
+++ b/tests/texp.c
@@ -46,7 +46,7 @@ check3 (double d, mp_rnd_t rnd, double e)
mpfr_t x, y; double f; int u=0, ck=0;
mpfr_init2(x, 53); mpfr_init2(y, 53);
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
mpfr_set_machine_rnd_mode(rnd);
#endif
if (e==0.0) e = exp(d); else ck=1; /* really check */
@@ -216,7 +216,7 @@ compare_exp2_exp3 (int n)
int
main (int argc, char *argv[])
{
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
int i, N, s=0, e, maxe=0;
double lo, hi;
#endif
@@ -272,7 +272,7 @@ main (int argc, char *argv[])
check3(5.30015757134837031117e+02, GMP_RNDD, 1.5237672861171573939e230);
check3(5.16239362447650933063e+02, GMP_RNDZ, 1.5845518406744492105e224);
check3(6.00812634798592370977e-01, GMP_RNDN, 1.823600119339019443);
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
SEED_RAND (time(NULL));
N = (argc==1) ? 0 : atoi(argv[1]);
lo = (argc>=3) ? atof(argv[2]) : -7.083964185e2;
diff --git a/tests/tget_d.c b/tests/tget_d.c
index 754fc74cb..c98056d8d 100644
--- a/tests/tget_d.c
+++ b/tests/tget_d.c
@@ -61,7 +61,7 @@ int
main (void)
{
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
mpfr_t half, x, y;
mp_rnd_t rnd_mode;
diff --git a/tests/tget_str.c b/tests/tget_str.c
index 7eceb19c0..ea49c4069 100644
--- a/tests/tget_str.c
+++ b/tests/tget_str.c
@@ -26,7 +26,7 @@ MA 02111-1307, USA. */
#include <time.h>
#include "gmp.h"
#include "mpfr.h"
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
#include "mpfr-test.h"
#endif
@@ -105,7 +105,7 @@ check_small (void)
int
main (int argc, char *argv[])
{
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
int i;
double d;
diff --git a/tests/tlog.c b/tests/tlog.c
index 3a0dcd1c4..55fdd70bc 100644
--- a/tests/tlog.c
+++ b/tests/tlog.c
@@ -67,7 +67,7 @@ check1 (double a, mp_rnd_t rnd_mode, double res1, int ck, int max_ulp)
int diff=0;
/* ck=1 iff res1 is certified correct */
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
mpfr_set_machine_rnd_mode(rnd_mode);
#endif
if (ck==0 && res1==0.0) res1=log(a);
diff --git a/tests/tmul.c b/tests/tmul.c
index 7b572a7f5..acd2cd393 100644
--- a/tests/tmul.c
+++ b/tests/tmul.c
@@ -52,7 +52,7 @@ check (double x, double y, mp_rnd_t rnd_mode, unsigned int px,
mpfr_set_d(xx, x, rnd_mode);
mpfr_set_d(yy, y, rnd_mode);
mpfr_mul(zz, xx, yy, rnd_mode);
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
mpfr_set_machine_rnd_mode(rnd_mode);
#endif
z1 = (res==0.0) ? x*y : res;
@@ -349,7 +349,7 @@ check_min(void)
int
main (int argc, char *argv[])
{
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
double x, y, z;
int i, prec, rnd_mode;
@@ -389,7 +389,7 @@ main (int argc, char *argv[])
49, 3, 2, 0.09375);
check_max();
check_min();
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
SEED_RAND (time(NULL));
prec = (argc<2) ? 53 : atoi(argv[1]);
rnd_mode = (argc<3) ? -1 : atoi(argv[2]);
diff --git a/tests/tset_q.c b/tests/tset_q.c
index 57497843f..b26d39119 100644
--- a/tests/tset_q.c
+++ b/tests/tset_q.c
@@ -40,7 +40,7 @@ check (long int n, long int d, mp_rnd_t rnd, double y)
mpfr_init2 (t, mpfr_get_prec (x) + mp_bits_per_limb);
mpq_init (q);
mpq_set_si (q, n, d);
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
mpfr_set_machine_rnd_mode (rnd);
y = (double) n / d;
#endif
@@ -80,7 +80,7 @@ check (long int n, long int d, mp_rnd_t rnd, double y)
int
main (void)
{
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
long int i, n;
unsigned long int d;
double y;
diff --git a/tests/tsqrt.c b/tests/tsqrt.c
index bf6f1f5e5..5cd5e4ffa 100644
--- a/tests/tsqrt.c
+++ b/tests/tsqrt.c
@@ -49,7 +49,7 @@ check3 (double a, mp_rnd_t rnd_mode, double Q)
ck = (Q!=-1.0); /* if ck=1, then Q is certified correct */
mpfr_init2(q, 53);
mpfr_set_d(q, a, rnd_mode);
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
mpfr_set_machine_rnd_mode(rnd_mode);
#endif
mpfr_sqrt(q, q, rnd_mode);
@@ -326,7 +326,7 @@ main (void)
double a;
mp_prec_t p;
int k;
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
int i;
mpfr_test_init ();
diff --git a/tests/tsqrt_ui.c b/tests/tsqrt_ui.c
index f3c7efabf..aab744847 100644
--- a/tests/tsqrt_ui.c
+++ b/tests/tsqrt_ui.c
@@ -37,7 +37,7 @@ check (unsigned long a, mp_rnd_t rnd_mode, double Q)
mpfr_t q; double Q2; int u, ck;
mpfr_init2(q, 53);
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
mpfr_set_machine_rnd_mode(rnd_mode);
#endif
mpfr_sqrt_ui(q, a, rnd_mode);
@@ -59,7 +59,7 @@ check (unsigned long a, mp_rnd_t rnd_mode, double Q)
int
main (void)
{
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
int i;
unsigned long a;
diff --git a/tests/tsub_ui.c b/tests/tsub_ui.c
index eccc97dc4..da1e222bb 100644
--- a/tests/tsub_ui.c
+++ b/tests/tsub_ui.c
@@ -47,7 +47,7 @@ check3 (double x, unsigned long y, mp_rnd_t rnd_mode, double z1)
mpfr_set_prec(zz, 53);
mpfr_set_d(xx, x, rnd_mode);
mpfr_sub_ui(zz, xx, y, rnd_mode);
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
mpfr_set_machine_rnd_mode(rnd_mode);
#endif
if (z1==0.0) z1 = x-y;
@@ -114,7 +114,7 @@ main (int argc, char *argv[])
{
mp_prec_t p;
int k;
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
double x; unsigned long y, N; int i,rnd_mode,rnd;
mpfr_test_init ();
diff --git a/tests/tui_div.c b/tests/tui_div.c
index 770faed5b..9f0d99724 100644
--- a/tests/tui_div.c
+++ b/tests/tui_div.c
@@ -44,7 +44,7 @@ check (unsigned long y, double x, mp_rnd_t rnd_mode, double z1)
mpfr_init2(zz, 53);
mpfr_set_d(xx, x, rnd_mode);
mpfr_ui_div(zz, y, xx, rnd_mode);
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
mpfr_set_machine_rnd_mode(rnd_mode);
#endif
if (z1==0.0) z1 = y/x;
@@ -152,7 +152,7 @@ check_nan (void)
int
main (int argc, char *argv[])
{
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
double x;
unsigned long y, N;
int i, rnd_mode, rnd;
diff --git a/tests/tui_sub.c b/tests/tui_sub.c
index 2d34dc56d..bfbdd60d2 100644
--- a/tests/tui_sub.c
+++ b/tests/tui_sub.c
@@ -140,7 +140,7 @@ check (unsigned long y, double x, mp_rnd_t rnd_mode, double z1)
mpfr_init2(zz, 53);
mpfr_set_d(xx, x, rnd_mode);
mpfr_ui_sub(zz, y, xx, rnd_mode);
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
mpfr_set_machine_rnd_mode(rnd_mode);
#endif
if (z1==0.0) z1 = y-x;
@@ -204,7 +204,7 @@ main (int argc, char *argv[])
{
mp_prec_t p;
unsigned k;
-#ifdef HAVE_FENV_H
+#ifdef HAVE_FESETROUND
double x;
unsigned long y, N;
int i, rnd_mode, rnd;