Commit | Line | Data |
---|---|---|
0632022a KB |
1 | .\" Copyright (c) 1990 The Regents of the University of California. |
2 | .\" All rights reserved. | |
fc9e796e | 3 | .\" |
0632022a KB |
4 | .\" %sccs.include.redist.man% |
5 | .\" | |
6 | .\" @(#)rand.3 6.5 (Berkeley) %G% | |
7 | .\" | |
8 | .TH RAND 3 "" | |
fc9e796e KM |
9 | .AT 3 |
10 | .SH NAME | |
0632022a | 11 | rand, srand \- bad random number generator |
fc9e796e KM |
12 | .SH SYNOPSIS |
13 | .nf | |
0632022a KB |
14 | .ft B |
15 | void | |
16 | srand(seed) | |
17 | unsigned int seed; | |
18 | ||
19 | rand() | |
fc9e796e KM |
20 | .fi |
21 | .SH DESCRIPTION | |
c9573fe5 | 22 | .ft B |
c140d685 | 23 | These interfaces are obsoleted by random(3). |
c9573fe5 KM |
24 | .ft R |
25 | .PP | |
0632022a KB |
26 | The |
27 | .I rand | |
28 | function computes a sequence of pseudo-random integers in the range | |
29 | of 0 to | |
30 | .I RAND_MAX | |
31 | (as defined by the header file <stdlib.h>). | |
fc9e796e | 32 | .PP |
0632022a | 33 | The |
fc9e796e | 34 | .I srand |
0632022a KB |
35 | function sets its argument as the seed for a new sequence of |
36 | pseudo-random numbers to be returned by | |
37 | .IR rand . | |
38 | These sequences are repeatable by calling | |
fc9e796e | 39 | .I srand |
0632022a KB |
40 | with the same seed value. |
41 | .PP | |
42 | If no seed value is provided, the functions are automatically | |
43 | seeded with a value of 1. | |
44 | .SH STANDARDS | |
45 | .B Rand | |
46 | and | |
47 | .B srand | |
48 | conform to ANSI X3.159-1989 (``ANSI C''). | |
c9573fe5 KM |
49 | .SH "SEE ALSO" |
50 | random(3) |