OxL Reference

method sim.rand

A deterministic random integer in lo..=hi; the sequence depends only on the seed.

Example:

oxl✓ checked in CI
use std.test { sim }

test sim "rand stays in range" seeds 1..=3 {
  let x = sim.rand(10, 20)
  assert x >= 10 && x < 20
}
pub(api) static fn rand(lo: i64, hi: i64) -> i64

Since. 1.0.0-beta

Parameters

NameType
loi64
hii64

Returns

i64

Effects

none declared (pure unless the body says otherwise)

Defined in: std/test/test.oxl:384

See also