1985-01-21 12:47:04 +00:00
|
|
|
/* $Header$ */
|
1984-11-29 14:22:02 +00:00
|
|
|
|
1991-09-04 16:01:22 +00:00
|
|
|
#if !defined(EM_WSIZE)
|
|
|
|
#define EM_WSIZE _EM_WSIZE
|
|
|
|
#endif
|
|
|
|
|
1985-01-21 12:37:26 +00:00
|
|
|
_randomi()
|
1984-11-29 14:22:02 +00:00
|
|
|
{
|
|
|
|
int i;
|
1985-01-21 12:37:26 +00:00
|
|
|
_setchan(-1);
|
1984-11-29 14:22:02 +00:00
|
|
|
printf("Random number seed (-32768 to 32767) ? ");
|
|
|
|
_readint(&i);
|
1988-07-01 17:30:06 +00:00
|
|
|
_setrand(i);
|
1984-11-29 14:22:02 +00:00
|
|
|
}
|
|
|
|
|
1988-07-01 17:30:06 +00:00
|
|
|
_setrand(i)
|
1984-11-29 14:22:02 +00:00
|
|
|
int i;
|
1988-07-01 17:30:06 +00:00
|
|
|
{
|
1984-11-29 14:22:02 +00:00
|
|
|
srand(i);
|
|
|
|
}
|
|
|
|
double _rnd(d) double d;
|
|
|
|
{
|
|
|
|
double f; f= (int) rand();
|
1988-07-01 17:30:06 +00:00
|
|
|
return(f/
|
|
|
|
#if EM_WSIZE == 4
|
|
|
|
2147483647.0
|
|
|
|
#else
|
|
|
|
32767.0
|
|
|
|
#endif
|
|
|
|
);
|
1984-11-29 14:22:02 +00:00
|
|
|
}
|