method sim.rand
A deterministic random integer in lo..=hi; the sequence depends only on the seed.
Example:
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) -> i64Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
lo | i64 |
hi | i64 |
Returns
i64
Effects
none declared (pure unless the body says otherwise)
Defined in: std/test/test.oxl:384