This is brrand.m in view mode; [Download] [Up]
/* block version of rrand */
/* a modification of unix rand() to return floating point values between
+ and - 1. */
static long randx = 1;
sbrrand(x)
unsigned x;
{
randx = x;
}
brrand(amp,a,j)
float amp,*a;
{
int k;
for(k=0; k<j; k++) {
int i = ((randx = randx*1103515245 + 12345)>>16) & 077777;
*a++ = amp * ((float)i/16384. - 1.);
}
}
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.