1RAND(3) Library Functions Manual RAND(3)
23
4
NAME
6rand, srand - random number generator
7
SYNOPSIS
9srand(seed)
10int seed;
1112
rand( )
13
DESCRIPTION
15Rand uses a multiplicative congruential random number generator with
16period 232 to return successive pseudo-random numbers in the range from
170 to 215-1.
1819
The generator is reinitialized by calling srand with 1 as argument. It
20can be set to a random starting point by calling srand with whatever
21you like as argument.
2223
24
25
RAND(3)