diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-03-21 15:35:48 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-03-21 15:35:48 +0000 |
commit | 7563e1b2676d837c96ed25e361a5e9dd714567dc (patch) | |
tree | 33906130053295abaaf74e98f81b794b8eece54b /tests/tui_sub.c | |
parent | 0df22d500aef3b11656722b40e21890ee1a5c531 (diff) | |
download | mpfr-7563e1b2676d837c96ed25e361a5e9dd714567dc.tar.gz |
replaced rand/lrand48, drand48, srand/srand48 by macros
LONG_RAND, DBL_RAND, SEED_RAND
and time(NULL) by getpid()
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1762 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tui_sub.c')
-rw-r--r-- | tests/tui_sub.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/tui_sub.c b/tests/tui_sub.c index 89b9bba6f..495bbf338 100644 --- a/tests/tui_sub.c +++ b/tests/tui_sub.c @@ -168,11 +168,11 @@ check_two_sum (mp_prec_t p) mpfr_init2 (w, p); do { - x = lrand48 (); + x = LONG_RAND (); } while (x < 1); mpfr_random (y); - rnd = rand() % 4; + rnd = LONG_RAND() % 4; rnd = GMP_RNDN; inexact = mpfr_ui_sub (u, x, y, GMP_RNDN); mpfr_sub_ui (v, u, x, GMP_RNDN); @@ -215,15 +215,15 @@ main (int argc, char *argv[]) set_fpc_csr(exp.fc_word); #endif - srand48(getpid()); + SEED_RAND (getpid()); N = (argc<2) ? 1000000 : atoi(argv[1]); rnd_mode = (argc<3) ? -1 : atoi(argv[2]); for (i=0;i<1000000;i++) { - x = drand(); - y = lrand48(); + x = drand (); + y = LONG_RAND (); if (ABS(x)>2.2e-307) { /* avoid denormalized numbers and overflows */ - rnd = (rnd_mode==-1) ? lrand48()%4 : rnd_mode; + rnd = (rnd_mode==-1) ? LONG_RAND()%4 : rnd_mode; check(y, x, rnd, 0.0); } } |