summaryrefslogtreecommitdiff
path: root/tests/tadd_ui.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2002-03-21 15:35:48 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2002-03-21 15:35:48 +0000
commit7563e1b2676d837c96ed25e361a5e9dd714567dc (patch)
tree33906130053295abaaf74e98f81b794b8eece54b /tests/tadd_ui.c
parent0df22d500aef3b11656722b40e21890ee1a5c531 (diff)
downloadmpfr-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/tadd_ui.c')
-rw-r--r--tests/tadd_ui.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/tadd_ui.c b/tests/tadd_ui.c
index 778062ad2..394a31548 100644
--- a/tests/tadd_ui.c
+++ b/tests/tadd_ui.c
@@ -28,9 +28,7 @@ MA 02111-1307, USA. */
#include "gmp.h"
#include "mpfr.h"
#include "mpfr-impl.h"
-#ifdef __mips
-#include <sys/fpu.h>
-#endif
+#include "mpfr-test.h"
void check3 _PROTO((double, unsigned long, unsigned int, double));
void special _PROTO((void));
@@ -90,15 +88,15 @@ main (int argc, char *argv[])
set_fpc_csr(exp.fc_word);
#endif
- srand(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 = drand48();
- y = lrand48();
+ x = drand();
+ y = LONG_RAND();
if (ABS(x)>2.2e-307 && x+y<1.7e+308 && x+y>-1.7e308) {
/* avoid denormalized numbers and overflows */
- rnd = (rnd_mode==-1) ? lrand48()%4 : rnd_mode;
+ rnd = (rnd_mode==-1) ? LONG_RAND()%4 : rnd_mode;
check(x, y, rnd);
}
}