ack/lang/basic/lib/random.c
1984-11-29 14:22:02 +00:00

26 lines
291 B
C

/* $Header $ */
_randomize()
{
int i;
double f;
_setchannel(-1);
printf("Random number seed (-32768 to 32767) ? ");
_readint(&i);
f=i;
_setrandom(f);
}
_setrandom(f)
double f;
{
int i;
i=f;
srand(i);
}
double _rnd(d) double d;
{
double f; f= (int) rand();
return(f/32767.0);
}