changeset 39348 | 6f9c9899f99f |
child 39408 | 65a379f4c8f3 |
39347:50dec19e682b | 39348:6f9c9899f99f |
---|---|
1 (* Title: Tools/random_word.ML |
|
2 Author: Makarius |
|
3 |
|
4 Simple generator for pseudo-random numbers, using unboxed word |
|
5 arithmetic only. Unprotected concurrency introduces some true |
|
6 randomness. |
|
7 *) |
|
8 |
|
9 signature Random = |
|
10 sig |
|
11 |
|
12 val nextWord : unit -> word |
|
13 |
|
14 val nextBool : unit -> bool |
|
15 |
|
16 val nextInt : int -> int (* k -> [0,k) *) |
|
17 |
|
18 val nextReal : unit -> real (* () -> [0,1) *) |
|
19 |
|
20 end; |