home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Education Sampler 1992 [NeXTSTEP]
/
Education_1992_Sampler.iso
/
SoundAndMusic
/
Hyperupic
/
Hyperupic.app
/
rand.c
< prev
next >
Wrap
Text File
|
1992-08-10
|
301b
|
20 lines
static long randx = 1;
void srrand(x)
unsigned x;
{
randx = x;
}
float rrand()
{
int i = ((randx = randx*1103515245 + 12345)>>16) & 077777;
return((float)i/16384. - 1.);
}
float prand()
{
int i = ((randx = randx*1103515245 + 12345)>>16) & 077777;
return((float)i/32768.);
}