source: trunk/minix/man/man3/rand.3@ 20

Last change on this file since 20 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 646 bytes
Line 
1.\" @(#)rand.3c 6.2 (Berkeley) 9/29/85
2.\"
3.TH RAND 3 "September 29, 1985"
4.AT 3
5.SH NAME
6rand, srand \- random number generator
7.SH SYNOPSIS
8.nf
9.ft B
10#include <stdlib.h>
11
12void srand(unsigned \fIseed\fP)
13unsigned rand(void)
14.ft R
15.fi
16.SH DESCRIPTION
17.B Rand
18uses a multiplicative congruential
19random number generator with period
20.if t 2\u\s732\s0\d
21.if n 2**32
22to return successive pseudo-random
23numbers in the range from 0 to
24.BR RAND_MAX .
25.PP
26The generator is reinitialized by calling
27.B srand
28with 1 as argument.
29It can be set to a random starting point by calling
30.B srand
31with whatever you like as argument.
32.SH "SEE ALSO"
33.BR random (3).
Note: See TracBrowser for help on using the repository browser.