Random module

Random_State

structSource

The generator's 128-bit state, as two halves. Seed it with random_seed before drawing: an all-zero state (a plain state: Random_State;) is a fixed point of the generator and only ever yields zero.

Seeding keeps the low half odd, which is what gives the generator its full period; the draw itself needs no other setup.

Example↗
state: Random_State;
random_seed(*state, cast(u64) 5);
assert(random_get(*state) != 0);

Fields

low: u64
high: u64

See also