1 --- random.3 2004-11-25 11:38:42.000000000 -0800
2 +++ random.3.edit 2006-07-12 11:25:20.000000000 -0700
15 .Nd better random number generator; routines for changing generators
33 +.Fa "const char *state"
36 -.Fn srandom "unsigned long seed"
43 -.Fn initstate "unsigned long seed" "char *state" "long n"
45 -.Fn setstate "char *state"
53 -uses a non-linear additive feedback random number generator employing a
54 -default table of size 31 long integers to return successive pseudo-random
55 +uses a non-linear, additive feedback, random number generator, employing a
56 +default table of size 31 long integers.
57 +It returns successive pseudo-random
58 numbers in the range from 0 to
59 .if t 2\u\s731\s10\d\(mi1.
63 produces a much less random sequence \(em in fact, the low dozen bits
64 generated by rand go through a cyclic pattern.
65 -All the bits generated by
66 +All of the bits generated by
74 -routine initializes a state array using the
75 +routine initializes a state array, using the
77 random number device which returns good random numbers,
78 suitable for cryptographic use.
80 the nearest known amount.
81 Using less than 8 bytes will cause an error.)
82 The seed for the initialization (which specifies a starting point for
83 -the random number sequence, and provides for restarting at the same
84 +the random number sequence and provides for restarting at the same
85 point) is also an argument.
89 With 256 bytes of state information, the period of the random number
90 generator is greater than
94 which should be sufficient for most purposes.
99 detects that the state information has been garbled, error
100 messages are printed on the standard error output.
102 +.Fd #include <stdlib.h>
107 +.Fa "unsigned long seed"
121 +.Fa "unsigned long seed"
124 +The type of each parameter is different in the legacy version.
134 functions appeared in