1Random.State(3) OCaml library Random.State(3)
2
3
4
6 Random.State - no description
7
9 Module Random.State
10
12 Module State
13 : sig end
14
15
16
17
18
19
20
21 type t
22
23
24 The type of PRNG states.
25
26
27
28 val make : int array -> t
29
30 Create a new state and initialize it with the given seed.
31
32
33
34 val make_self_init : unit -> t
35
36 Create a new state and initialize it with a random seed chosen in a
37 system-dependent way. The seed is obtained as described in Ran‐
38 dom.self_init .
39
40
41
42 val copy : t -> t
43
44 Return a copy of the given state.
45
46
47
48 val bits : t -> int
49
50
51
52
53 val int : t -> int -> int
54
55
56
57
58 val full_int : t -> int -> int
59
60
61
62
63 val int32 : t -> Int32.t -> Int32.t
64
65
66
67
68 val nativeint : t -> Nativeint.t -> Nativeint.t
69
70
71
72
73 val int64 : t -> Int64.t -> Int64.t
74
75
76
77
78 val float : t -> float -> float
79
80
81
82
83 val bool : t -> bool
84
85
86
87
88 val bits32 : t -> Int32.t
89
90
91
92
93 val bits64 : t -> Int64.t
94
95
96
97
98 val nativebits : t -> Nativeint.t
99
100 These functions are the same as the basic functions, except that they
101 use (and update) the given PRNG state instead of the default one.
102
103
104
105 val split : t -> t
106
107 Draw a fresh PRNG state from the given PRNG state. (The given PRNG
108 state is modified.) The new PRNG is statistically independent from the
109 given PRNG. Data can be drawn from both PRNGs, in any order, without
110 risk of correlation. Both PRNGs can be split later, arbitrarily many
111 times.
112
113
114 Since 5.0.0
115
116
117
118
119
120OCamldoc 2023-07-20 Random.State(3)