summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/random.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/stdlib/random.3')
-rw-r--r--src/lib/libc/stdlib/random.313
1 files changed, 4 insertions, 9 deletions
diff --git a/src/lib/libc/stdlib/random.3 b/src/lib/libc/stdlib/random.3
index e1ab9e44da..7b8a566115 100644
--- a/src/lib/libc/stdlib/random.3
+++ b/src/lib/libc/stdlib/random.3
@@ -29,7 +29,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 30.\" SUCH DAMAGE.
31.\" 31.\"
32.\" $OpenBSD: random.3,v 1.8 1999/06/29 18:36:23 aaron Exp $ 32.\" $OpenBSD: random.3,v 1.9 1999/07/04 18:59:43 aaron Exp $
33.\" 33.\"
34.Dd April 19, 1991 34.Dd April 19, 1991
35.Dt RANDOM 3 35.Dt RANDOM 3
@@ -56,9 +56,7 @@ The
56function 56function
57uses a non-linear additive feedback random number generator employing a 57uses a non-linear additive feedback random number generator employing a
58default table of size 31 long integers to return successive pseudo-random 58default table of size 31 long integers to return successive pseudo-random
59numbers in the range from 0 to 59numbers in the range from 0 to (2**31)\-1.
60.if t 2\u\s731\s10\d\(mi1.
61.if n (2**31)\(mi1.
62The maximum value returned by 60The maximum value returned by
63.Fn random 61.Fn random
64is 62is
@@ -66,8 +64,7 @@ is
66(as defined by the header file 64(as defined by the header file
67.Aq Pa limits.h ) . 65.Aq Pa limits.h ) .
68The period of this random number generator is very large, approximately 66The period of this random number generator is very large, approximately
69.if t 16\(mu(2\u\s731\s10\d\(mi1). 6716*((2**31)\-1.
70.if n 16*((2**31)\(mi1).
71.Pp 68.Pp
72The 69The
73.Fn random Ns / Fn srandom 70.Fn random Ns / Fn srandom
@@ -148,9 +145,7 @@ is that the size of the state array does not have to be remembered after
148it is initialized. 145it is initialized.
149.Pp 146.Pp
150With 256 bytes of state information, the period of the random number 147With 256 bytes of state information, the period of the random number
151generator is greater than 148generator is greater than 2**69
152.if t 2\u\s769\s10\d,
153.if n 2**69
154which should be sufficient for most purposes. 149which should be sufficient for most purposes.
155.Sh AUTHOR 150.Sh AUTHOR
156Earl T. Cohen 151Earl T. Cohen