Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/smlnj-lib/Util/random-sig.sml
ViewVC logotype

Annotation of /sml/trunk/src/smlnj-lib/Util/random-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (view) (download)

1 : monnier 2 (* random-sig.sml
2 :     *
3 :     * COPYRIGHT (c) 1993 by AT&T Bell Laboratories. See COPYRIGHT file for details.
4 :     *)
5 :    
6 :     signature RANDOM =
7 :     sig
8 :    
9 :     type rand
10 :     (* the internal state of a random number generator *)
11 :    
12 :     val rand : (int * int) -> rand
13 :     (* create rand from initial seed *)
14 :    
15 :     val toString : rand -> string
16 :     val fromString : string -> rand
17 :     (* convert state to and from string
18 :     * fromString raises Fail if its argument
19 :     * does not have the proper form.
20 :     *)
21 :    
22 :     val randInt : rand -> int
23 :     (* generate ints uniformly in [minInt,maxInt] *)
24 :    
25 :     val randNat : rand -> int
26 :     (* generate ints uniformly in [0,maxInt] *)
27 :    
28 :     val randReal : rand -> real
29 :     (* generate reals uniformly in [0.0,1.0) *)
30 :    
31 :     val randRange : (int * int) -> rand -> int
32 :     (* randRange (lo,hi) generates integers uniformly [lo,hi].
33 :     * Raises Fail if hi < lo.
34 :     *)
35 :    
36 :     end; (* RANDOM *)
37 :    

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0