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/benchmarks/programs/b-hut/rand-sig.sml
ViewVC logotype

Annotation of /sml/trunk/benchmarks/programs/b-hut/rand-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 193 - (view) (download)

1 : monnier 193 (* rand-sig.sml
2 :     *
3 :     * COPYRIGHT (c) 1993 by AT&T Bell Laboratories. See COPYRIGHT file for details.
4 :     *
5 :     * Signature for a simple random number generator.
6 :     *
7 :     *)
8 :    
9 :     signature RAND =
10 :     sig
11 :    
12 :     val randMin : real
13 :     val randMax : real
14 :     val random : real -> real
15 :     (* Given seed, return value randMin <= v <= randMax
16 :     * Iteratively using the value returned by random as the
17 :     * next seed to random will produce a sequence of pseudo-random
18 :     * numbers.
19 :     *)
20 :    
21 :     val mkRandom : real -> unit -> real
22 :     (* Given seed, return function generating a sequence of
23 :     * random numbers randMin <= v <= randMax
24 :     *)
25 :    
26 :     val norm : real -> real
27 :     (* r -> r / (randMax + 1.0) *)
28 :    
29 :     val range : (int * int) -> real -> int
30 :     (* Map v, randMin <= v <= randMax to integer range [i,j]
31 :     * Exception -
32 :     * BadArg if j < i
33 :     *)
34 :    
35 :     end (* RAND *)

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