Standard library
PRNG
Seeded non-cryptographic PRNG.
Introduction
Seeded non-cryptographic PRNG. Import std/random to bind the module as random. Call free functions as random.name(...). Struct methods use a receiver value.
/ std/random
This page is the package reference for std/random. Private helpers used only by co-located tests are not listed.
Functions
Free functions on random. Each function has a short description, an example, then parameters and return shape.
seed
Seeds the non-crypto PRNG. Call form: random.seed(s).
/ std/random
random.seed(1)
Parameters: s: integer seed. Returns: None.
u64
Returns the next non-crypto PRNG integer. Call form: random.u64().
/ std/random
random.seed(1)
$ n = random.u64()
Parameters: No parameters. Returns: Integer random value.
float
Returns the next non-crypto PRNG float in [0, 1). Call form: random.float().
/ std/random
random.seed(1)
$ x = random.float()
Parameters: No parameters. Returns: Float random value.