gen_r ~g low high
picks a value from the interval [low, high - 1]
uniformly at random.
gen_bits ~g ~msb n
picks a bit-string n
bits long, with msb
most significant bits set, and interprets it as a t in big-endidan. This yields a value in the interval [2^(n-1) + ... + 2^(n-msb), 2^n - 1]
.
msb
defaults to 0
which reduces gen_bits k
to gen 2^k
.