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

SCM Repository

[smlnj] View of /sml/branches/SMLNJ/src/smlnj-lib/Util/OLDrand-sig.sml
ViewVC logotype

View of /sml/branches/SMLNJ/src/smlnj-lib/Util/OLDrand-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 27 - (download) (annotate)
Thu Mar 12 01:05:57 1998 UTC (21 years, 7 months ago)
File size: 893 byte(s)
This commit was manufactured by cvs2svn to create branch 'SMLNJ'.
(* rand-sig.sml
 *
 * COPYRIGHT (c) 1993 by AT&T Bell Laboratories.  See COPYRIGHT file for details.
 *
 * Signature for a simple random number generator.
 *
 *)

signature RAND =
  sig

    val randMin : real
    val randMax : real
    val random : real -> real
      (* Given seed, return value randMin <= v <= randMax
       * Iteratively using the value returned by random as the
       * next seed to random will produce a sequence of pseudo-random
       * numbers.
       *)

    val mkRandom : real -> unit -> real
      (* Given seed, return function generating a sequence of
       * random numbers randMin <= v <= randMax
       *)

    val norm : real -> real
      (* r -> r / (randMax + 1.0) *)

    val range : (int * int) -> real -> int 
      (* Map v, randMin <= v <= randMax to integer range [i,j]
       * Exception -
       *   BadArg if j < i
       *)

  end (* RAND *)

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