Random Library

Previous Page TOC Index Next Page See Page

Mindy Compiler Mindy Debugger Mindy Object Extensions Streams Library Standard IO Print Library Format Library Melange Interface TK Library Collection extensions Table Extensions String extensions Regular Expressions Transcendental Library Time Library Random Library Matrix Library

The Random Library

Designed by the Gwydion Project

The Random library provides random number support in several random number distributions. The Random module of the Random library exports the following names:

random [Function]

(upper-bound :: <integer>, #key state) => uniform-random-number :: <integer>;

random-bits [Function]

(#key state) => uniform-random-number :: <fixed-integer>;

$random-bits-count [Constant]

random-float [Function]

(upper-bound :: <number>, #key state) => uniform-random-number :: <float>;

random-gaussian [Function]

(#key mean = 0, standard-deviation = 1, state)

random-exponential [Function]

(#key lambda = 1, state)

<random-state> [Sealed Class]

All of the random functions optionally take a state: keyword, which specifies the <random-state> to use. If a state is not specified, a default state will be used. In a multi-threaded environment, using the default state is guaranteed to be threadsafe. Implementations may use a unique default state object per thread, or a single default state object shared by all threads but accessed in a safe way. Random-states other than the default state objects are not threadsafe.

Mindy Compiler Mindy Debugger Mindy Object Extensions Streams Library Standard IO Print Library Format Library Melange Interface TK Library Collection extensions Table Extensions String extensions Regular Expressions Transcendental Library Time Library Random Library Matrix Library

Previous Page TOC Index Next Page See Page

Copyright 1994, 1995, 1996, 1997 Carnegie Mellon University. All rights reserved.

Send comments and bug reports to gwydion-bugs@cs.cmu.edu