OxL Справочник OxL
РусскийEnglish

method sim.rand

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

Example:

oxl✓ проверяется в 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

С версии. 1.0.0-beta

Параметры

ИмяТип
loi64
hii64

Возвращает

i64

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/test/test.oxl:384

См. также