RAND(3C) Silicon Graphics RAND(3C) NAME rand, srand - simple random-number generator SYNOPSIS #include int rand (void); void srand (unsigned int seed); DESCRIPTION rand uses a multiplicative congruential random-number generator with period 2^32 that returns successive pseudo-random numbers in the range from 0 to RAND_MAX. RAND_MAX is a constant defined in . At the time of this writing, its value is (2^15)-1. srand can be called at any time to reset the random-number generator to a starting point particular to the seed. Different seeds must be used to generate different sequences of random numbers. The same sequence is always generated for a particular seed. The generator is initially seeded with a value of 1. NOTES The spectral properties of rand are limited. drand48(3C) and random(3C) provide a much better, though more elaborate, random-number generator. SEE ALSO drand48(3C), random(3C) Page 1 Release 3.10 June 1992