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
fun random_new(seed: Int) -> RandomNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
random_next_int
fun random_next_int(rng: Random) -> IntNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
random_float
fun random_float(rng: Random) -> FloatNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
random_int
fun random_int(rng: Random, lo: Int, hi: Int) -> IntNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
random_choice
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
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
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
fun random_normal(rng: Random, mean: Float, stddev: Float) -> FloatNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
Types
Random
struct Random { state: Int }No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
Constants
RANDOM_MODULUS
let RANDOM_MODULUS: Int = 2147483647;No description yet. Read the declaration source for the exact contract.
supported · full runtime · source