Bell 32V release
[unix-history] / usr / man / man3 / rand.3
CommitLineData
d2b358fb
TL
1.TH RAND 3 "UNIX/32V"
2.SH NAME
3rand, srand \- random number generator
4.SH SYNOPSIS
5.B srand(seed)
6.br
7.B int seed;
8.PP
9.B rand( )
10.SH DESCRIPTION
11.I Rand
12uses a multiplicative congruential
13random number generator
14with period 2\u\s732\s0\d
15to return successive pseudo-random
16numbers in the range from 0 to 2\u\s731\s10\d\-1.
17.PP
18The generator is reinitialized by calling
19.I srand
20with 1 as argument.
21It can be set to a random starting point by calling
22.I srand
23with whatever you like as argument.