random module

Maylang standard-library module.

import "random" as random;

Module note — All draws mutate the explicit RNG state. This generator is intended for repeatable tests/simulations; it is not a cryptographic generator.

Functions

random_new

may
fun random_new(seed: Int) -> Random

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

random_next_int

may
fun random_next_int(rng: Random) -> Int

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

random_float

may
fun random_float(rng: Random) -> Float

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

random_int

may
fun random_int(rng: Random, lo: Int, hi: Int) -> Int

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

random_choice

may
fun random_choice<T>(rng: Random, xs: List<T>) -> Optional<T>

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

random_shuffle

may
fun random_shuffle<T>(rng: Random, xs: List<T>) -> List<T>

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

random_sample

may
fun random_sample<T>(rng: Random, xs: List<T>, count: Int) -> List<T>

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

random_normal

may
fun random_normal(rng: Random, mean: Float, stddev: Float) -> Float

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

Types

Random

may
struct Random { state: Int }

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

Constants

RANDOM_MODULUS

may
let RANDOM_MODULUS: Int = 2147483647;

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source