## random.api
# Compiled by:
#
src/lib/std/standard.lib### "I've heard that the government
### wants to put a tax on the
### mathematically ignorant.
###
### "Funny, I thought that's what
### the lottery was!"
###
### -- Gallagher
api Random {
Random_Number_Generator;
# the internal state of a random number generator
make_random_number_generator: ((Int, Int)) -> Random_Number_Generator;
# Create rand from initial seed
to_string: Random_Number_Generator -> String;
from_string: String -> Random_Number_Generator;
/* convert state to and from string
* from_string raises DIE if its argument
* does not have the proper form.
*/
int: Random_Number_Generator -> Int;
# generate ints uniformly in [min_int, max_int]
nonnegative_int: Random_Number_Generator -> Int;
#
# Generate ints uniformly in [0, max_int]
float01: Random_Number_Generator -> Float;
#
# Generate floats uniformly in [0.0, 1.0)
range: (Int, Int) -> Random_Number_Generator -> Int;
#
# random_range (lo, hi) generates integers uniformly [lo, hi].
# Raises DIE if hi < lo.
bool: Random_Number_Generator -> Bool;
};
## 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.