## rand.api
## COPYRIGHT (c) 1998 by AT&T Laboratories.
# Compiled by:
#
src/lib/std/standard.lib# Api for a simple random number generator.
### "The generation of random numbers is
### too important to be left to chance."
###
### -- Robert R. Coveyou
api Rand {
Rand = tagged_unt::Unt;
rand_min: Rand;
rand_max: Rand;
random: Rand -> Rand;
#
# 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.
make_random: Rand -> Void -> Rand;
#
# Given seed, return function generating a sequence of
# random numbers randMin <= v <= randMax
normalize: Rand -> Float;
#
# Map values in the range [randMin, randMax] to (0.0, 1.0)
range: (Int, Int) -> Rand -> Int;
#
# Map v, randMin <= v <= randMax, to integer range [i, j]
# Exception -
# DIE if j < i
};
## COPYRIGHT (c) 1993 by AT&T Bell Laboratories. See SMLNJ-COPYRIGHT file for details.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.