Provided by: ocaml-nox_4.02.3-5ubuntu2_amd64

**NAME**

Random - Pseudo-random number generators (PRNG).

**Module**

Module Random

**Documentation**

ModuleRandom:sigendPseudo-random number generators (PRNG).===Basicfunctions===valinit:int->unitInitialize the generator, using the argument as a seed. The same seed will always yield the same sequence of numbers.valfull_init:intarray->unitSame asRandom.initbut takes more data as seed.valself_init:unit->unitInitialize the generator with a random seed chosen in a system-dependent way. If/dev/urandomis available on the host machine, it is used to provide a highly random initial seed. Otherwise, a less random seed is computed from system parameters (current time, process IDs).valbits:unit->intReturn 30 random bits in a nonnegative integer.Before3.12.0used a different algorithm (affects all the following functions)valint:int->intRandom.intboundreturns a random integer between 0 (inclusive) andbound(exclusive).boundmust be greater than 0 and less than 2^{30.valint32:Int32.t->Int32.tRandom.int32boundreturns a random integer between 0 (inclusive) andbound(exclusive).boundmust be greater than 0.valnativeint:Nativeint.t->Nativeint.tRandom.nativeintboundreturns a random integer between 0 (inclusive) andbound(exclusive).boundmust be greater than 0.valint64:Int64.t->Int64.tRandom.int64boundreturns a random integer between 0 (inclusive) andbound(exclusive).boundmust be greater than 0.valfloat:float->floatRandom.floatboundreturns a random floating-point number between 0 andbound(inclusive). Ifboundis negative, the result is negative or zero. Ifboundis 0, the result is 0.valbool:unit->boolRandom.bool()returnstrueorfalsewith probability 0.5 each.===Advancedfunctions======Advancedfunctions======ThefunctionsfrommoduleStatemanipulatethecurrentstateoftherandomgeneratorexplicitly.ThisallowsusingoneorseveraldeterministicPRNGs,eveninamulti-threadedprogram,withoutinterferencefromotherpartsoftheprogram.===moduleState:sigendvalget_state:unit->State.tReturn the current state of the generator used by the basic functions.valset_state:State.t->unitSet the state of the generator used by the basic functions.