diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-03-25 17:10:50 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-03-25 17:10:50 +0000 |
commit | d118c2ab825a19f88c861b856a69402b8e4fbbb2 (patch) | |
tree | dc9b811d62e0c15a56c260b2ebdcf21675d197a0 /tests | |
parent | 91f92d11d2b95e7378c3508f745a51fc96490d05 (diff) | |
download | mpfr-d118c2ab825a19f88c861b856a69402b8e4fbbb2.tar.gz |
replaced getpid() by time(NULL)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1772 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tadd.c | 4 | ||||
-rw-r--r-- | tests/tadd_ui.c | 2 | ||||
-rw-r--r-- | tests/tagm.c | 4 | ||||
-rw-r--r-- | tests/tdiv.c | 2 | ||||
-rw-r--r-- | tests/tdiv_ui.c | 2 | ||||
-rw-r--r-- | tests/texp.c | 2 | ||||
-rw-r--r-- | tests/tget_str.c | 2 | ||||
-rw-r--r-- | tests/tlog.c | 2 | ||||
-rw-r--r-- | tests/tmul.c | 2 | ||||
-rw-r--r-- | tests/tmul_2exp.c | 2 | ||||
-rw-r--r-- | tests/tout_str.c | 2 | ||||
-rw-r--r-- | tests/trandom.c | 2 | ||||
-rw-r--r-- | tests/tset_d.c | 2 | ||||
-rw-r--r-- | tests/tset_f.c | 2 | ||||
-rw-r--r-- | tests/tset_q.c | 2 | ||||
-rw-r--r-- | tests/tset_si.c | 2 | ||||
-rw-r--r-- | tests/tset_str.c | 2 | ||||
-rw-r--r-- | tests/tset_z.c | 2 | ||||
-rw-r--r-- | tests/tsqrt.c | 2 | ||||
-rw-r--r-- | tests/tsqrt_ui.c | 2 | ||||
-rw-r--r-- | tests/tsub_ui.c | 2 | ||||
-rw-r--r-- | tests/tui_div.c | 2 | ||||
-rw-r--r-- | tests/tui_sub.c | 2 |
23 files changed, 25 insertions, 25 deletions
diff --git a/tests/tadd.c b/tests/tadd.c index e62ed4d17..2f0fcc450 100644 --- a/tests/tadd.c +++ b/tests/tadd.c @@ -23,12 +23,12 @@ MA 02111-1307, USA. */ #include <stdio.h> #include <stdlib.h> +#include <time.h> #include "gmp.h" #include "mpfr.h" #include "mpfr-impl.h" #include "mpfr-test.h" -extern int getpid(); void check _PROTO((double, double, mp_rnd_t, unsigned int, unsigned int, unsigned int, double)); void checknan _PROTO((double, double, mp_rnd_t, unsigned int, unsigned int, unsigned int)); void check3 _PROTO((double, double, mp_rnd_t)); @@ -705,7 +705,7 @@ main (int argc, char *argv[]) check53(3.14553393112021279444e-67, 3.14553401015952024126e-67, GMP_RNDU, 6.2910679412797336946e-67); - SEED_RAND (getpid ()); + SEED_RAND (time(NULL)); check53(5.43885304644369509058e+185,-1.87427265794105342763e-57,GMP_RNDN, 5.4388530464436950905e185); check53(5.43885304644369509058e+185,-1.87427265794105342763e-57, GMP_RNDZ, diff --git a/tests/tadd_ui.c b/tests/tadd_ui.c index f440747db..e1188eefd 100644 --- a/tests/tadd_ui.c +++ b/tests/tadd_ui.c @@ -89,7 +89,7 @@ main (int argc, char *argv[]) set_fpc_csr(exp.fc_word); #endif - SEED_RAND (getpid ()); + SEED_RAND (time(NULL)); N = (argc<2) ? 1000000 : atoi(argv[1]); rnd_mode = (argc<3) ? -1 : atoi(argv[2]); for (i=0;i<1000000;i++) { diff --git a/tests/tagm.c b/tests/tagm.c index a87c524d4..a4d7ee8a8 100644 --- a/tests/tagm.c +++ b/tests/tagm.c @@ -130,7 +130,6 @@ slave (int N, int p) double a,b; mpfr_t ta, tb, tres; - SEED_RAND (getpid ()); mpfr_init2(ta, 53); mpfr_init2(tb, 53); mpfr_init2(tres, p); @@ -151,6 +150,8 @@ main (int argc, char* argv[]) { int N; + SEED_RAND (time(NULL)); + if (argc==3) { /* tagm N p : N calculus with precision p*/ printf("Doing %d random tests in %d precision\n",atoi(argv[1]),atoi(argv[2])); slave(atoi(argv[1]),atoi(argv[2])); @@ -161,7 +162,6 @@ main (int argc, char* argv[]) int i; double a,b; - SEED_RAND (getpid ()); N = atoi(argv[1]); for (i=0;i<N;i++) { a = drand(); diff --git a/tests/tdiv.c b/tests/tdiv.c index 95a65413c..23253077c 100644 --- a/tests/tdiv.c +++ b/tests/tdiv.c @@ -443,7 +443,7 @@ main (int argc, char *argv[]) #ifdef TEST N = (argc>1) ? atoi(argv[1]) : 100000; - SEED_RAND (getpid ()); + SEED_RAND (time(NULL)); for (i=0;i<N;i++) { do { n = drand(); d = drand(); e = ABS(n)/ABS(d); } /* smallest normalized is 2^(-1022), largest is 2^(1023)*(2-2^(-52)) */ diff --git a/tests/tdiv_ui.c b/tests/tdiv_ui.c index 68299c4cb..c2716c8c3 100644 --- a/tests/tdiv_ui.c +++ b/tests/tdiv_ui.c @@ -177,7 +177,7 @@ main (int argc, char **argv) #ifdef TEST int i; unsigned long u; double d; - SEED_RAND (getpid ()); + SEED_RAND (time(NULL)); for (i=0;i<1000000;i++) { do { u = LONG_RAND(); } while (u==0); do { d = drand(); } while (ABS(d/u)<2.2e-307); diff --git a/tests/texp.c b/tests/texp.c index d50429ddb..b5d21976e 100644 --- a/tests/texp.c +++ b/tests/texp.c @@ -270,7 +270,7 @@ main (int argc, char *argv[]) check3(5.16239362447650933063e+02, GMP_RNDZ, 1.5845518406744492105e224); check3(6.00812634798592370977e-01, GMP_RNDN, 1.823600119339019443); #ifdef TEST - SEED_RAND (getpid()); + SEED_RAND (time(NULL)); N = (argc==1) ? 0 : atoi(argv[1]); lo = (argc>=3) ? atof(argv[2]) : -7.083964185e2; hi = (argc>=4) ? atof(argv[3]) : 7.097827129e2; diff --git a/tests/tget_str.c b/tests/tget_str.c index 0e984eef7..51ee0a99d 100644 --- a/tests/tget_str.c +++ b/tests/tget_str.c @@ -108,7 +108,7 @@ main (int argc, char *argv[]) #ifdef TEST int i; double d; - SEED_RAND (getpid ()); + SEED_RAND (time(NULL)); for (i=0;i<100000;i++) { do { d = drand(); } while (isnan(d)); check(d, GMP_RNDN); diff --git a/tests/tlog.c b/tests/tlog.c index 8e4a6fa84..b631ae6ec 100644 --- a/tests/tlog.c +++ b/tests/tlog.c @@ -271,7 +271,7 @@ main (int argc, char *argv[]) { int N=0; - SEED_RAND (getpid ()); + SEED_RAND (time(NULL)); if (argc==4) { /* tlog x prec rnd */ check3(atof(argv[1]), atoi(argv[2]), atoi(argv[3])); return 0; diff --git a/tests/tmul.c b/tests/tmul.c index f7e3b36a3..2e7d42727 100644 --- a/tests/tmul.c +++ b/tests/tmul.c @@ -377,7 +377,7 @@ main (int argc, char *argv[]) check_max(); check_min(); #ifdef TEST - SEED_RAND (getpid ()); + SEED_RAND (time(NULL)); prec = (argc<2) ? 53 : atoi(argv[1]); rnd_mode = (argc<3) ? -1 : atoi(argv[2]); for (i=0;i<1000000;) { diff --git a/tests/tmul_2exp.c b/tests/tmul_2exp.c index 47b206d07..7a0d36692 100644 --- a/tests/tmul_2exp.c +++ b/tests/tmul_2exp.c @@ -45,7 +45,7 @@ main (int argc, char *argv[]) mpfr_mul_2exp (w, w, 10, GMP_RNDZ); if (!MPFR_IS_NAN(w)) { fprintf(stderr, "NaN != NaN"); exit(-1); } - SEED_RAND (getpid ()); + SEED_RAND (time(NULL)); for (k = 0; k < 100000; k++) { x = DBL_RAND (); mpfr_set_d (w, x, 0); diff --git a/tests/tout_str.c b/tests/tout_str.c index 481b67362..244a095df 100644 --- a/tests/tout_str.c +++ b/tests/tout_str.c @@ -130,7 +130,7 @@ main (int argc, char *argv[]) check(7.02293374921793516813e-84, GMP_RNDN, 10); /* random tests */ - SEED_RAND (getpid ()); + SEED_RAND (time(NULL)); for (i=0;i<N;i++) { do diff --git a/tests/trandom.c b/tests/trandom.c index 3dd0c3761..e04e6bccb 100644 --- a/tests/trandom.c +++ b/tests/trandom.c @@ -135,7 +135,7 @@ test_urandomb (unsigned long nbtests, unsigned long prec, int verbose) for (k = 0; k < size_tab; ++k) tab[k] = 0; gmp_randinit (state, GMP_RAND_ALG_LC, 128); - gmp_randseed_ui (state, getpid ()); + gmp_randseed_ui (state, time(NULL)); for (k = 0; k < nbtests; k++) { mpfr_urandomb(x, state); diff --git a/tests/tset_d.c b/tests/tset_d.c index 559b8a4cb..00bb1b6eb 100644 --- a/tests/tset_d.c +++ b/tests/tset_d.c @@ -79,7 +79,7 @@ main (int argc, char *argv[]) mpfr_get_d(x)); exit(1); } - SEED_RAND (getpid ()); + SEED_RAND (time(NULL)); mpfr_set_d(x, 8.06294740693074521573e-310, 0); d = -6.72658901114033715233e-165; mpfr_set_d(x, d, 0); diff --git a/tests/tset_f.c b/tests/tset_f.c index a7cbac5a3..348b1e550 100644 --- a/tests/tset_f.c +++ b/tests/tset_f.c @@ -43,7 +43,7 @@ main (void) mpfr_set_prec (x, 100); mpfr_set_f (x, y, GMP_RNDN); - SEED_RAND (getpid ()); + SEED_RAND (time(NULL)); mpf_random2(y, 10, 0); mpfr_set_f(x, y, LONG_RAND() & 3); diff --git a/tests/tset_q.c b/tests/tset_q.c index 0751b769b..be2e20eef 100644 --- a/tests/tset_q.c +++ b/tests/tset_q.c @@ -86,7 +86,7 @@ main (void) double y; unsigned char rnd; - SEED_RAND(getpid()); + SEED_RAND(time(NULL)); for (i=0;i<1000000;i++) { n = LONG_RAND(); d = LONG_RAND(); diff --git a/tests/tset_si.c b/tests/tset_si.c index 2fd745d13..dd74a99d6 100644 --- a/tests/tset_si.c +++ b/tests/tset_si.c @@ -37,7 +37,7 @@ main (int argc, char *argv[]) mpfr_init2(x, 100); - SEED_RAND (getpid ()); + SEED_RAND (time(NULL)); N = (argc==1) ? 1000000 : atoi(argv[1]); diff --git a/tests/tset_str.c b/tests/tset_str.c index c0ec1b141..778c5d1e2 100644 --- a/tests/tset_str.c +++ b/tests/tset_str.c @@ -48,7 +48,7 @@ main (int argc, char *argv[]) return 0; } - SEED_RAND (getpid ()); + SEED_RAND (time(NULL)); nc = (argc > 1) ? atoi(argv[1]) : 53; if (nc < 100) diff --git a/tests/tset_z.c b/tests/tset_z.c index 05231102f..d1082fe5c 100644 --- a/tests/tset_z.c +++ b/tests/tset_z.c @@ -67,7 +67,7 @@ main (int argc, char *argv[]) long j; check_large(); - SEED_RAND (getpid ()); + SEED_RAND (time(NULL)); check(0, 0); for (j=0; j<1000000; j++) check(LONG_RAND(), LONG_RAND()%4); diff --git a/tests/tsqrt.c b/tests/tsqrt.c index ad491aec2..73666b41a 100644 --- a/tests/tsqrt.c +++ b/tests/tsqrt.c @@ -336,7 +336,7 @@ main (void) set_fpc_csr(exp.fc_word); #endif - SEED_RAND (getpid ()); + SEED_RAND (time(NULL)); for (i=0;i<100000;i++) { a = drand(); if (a < 0.0) a = -a; /* ensures a is positive */ diff --git a/tests/tsqrt_ui.c b/tests/tsqrt_ui.c index 16b8552f6..d40eb63d6 100644 --- a/tests/tsqrt_ui.c +++ b/tests/tsqrt_ui.c @@ -69,7 +69,7 @@ main (void) set_fpc_csr(exp.fc_word); #endif - SEED_RAND (getpid ()); + SEED_RAND (time(NULL)); for (i=0;i<1000000;i++) { a = LONG_RAND(); /* machine arithmetic must agree if a <= 2.0^53 */ diff --git a/tests/tsub_ui.c b/tests/tsub_ui.c index f980b8d90..5cad054bc 100644 --- a/tests/tsub_ui.c +++ b/tests/tsub_ui.c @@ -126,7 +126,7 @@ main (int argc, char *argv[]) #ifdef TEST double x; unsigned long y, N; int i,rnd_mode,rnd; - SEED_RAND (getpid ()); + SEED_RAND (time(NULL)); N = (argc<2) ? 1000000 : atoi(argv[1]); rnd_mode = (argc<3) ? -1 : atoi(argv[2]); for (i=0;i<1000000;i++) { diff --git a/tests/tui_div.c b/tests/tui_div.c index 18707a409..7dbf37a49 100644 --- a/tests/tui_div.c +++ b/tests/tui_div.c @@ -122,7 +122,7 @@ main (int argc, char *argv[]) set_fpc_csr(exp.fc_word); #endif - SEED_RAND(getpid()); + SEED_RAND(time(NULL)); N = (argc<2) ? 1000000 : atoi(argv[1]); rnd_mode = (argc<3) ? -1 : atoi(argv[2]); for (i=0;i<1000000;i++) { diff --git a/tests/tui_sub.c b/tests/tui_sub.c index d3918bfe5..10932334b 100644 --- a/tests/tui_sub.c +++ b/tests/tui_sub.c @@ -216,7 +216,7 @@ main (int argc, char *argv[]) set_fpc_csr(exp.fc_word); #endif - SEED_RAND (getpid()); + SEED_RAND (time(NULL)); N = (argc<2) ? 1000000 : atoi(argv[1]); rnd_mode = (argc<3) ? -1 : atoi(argv[2]); for (i=0;i<1000000;i++) { |