def intn

bend-collections-laws-math@1.0.0.0 · src/math/random/rand.bend:212

import bend-collections-laws-math@1.0.0.0/src/math/random/rand.bend as Rand
import Base
import bend-collections-laws-math@1.0.0.0/src/math/u64.bend as W

212# uniform in [0, n) for 0 < n < 2^48 (Go's IntN); (0, s) for n == 0
213def intn(~S: Data, ~next: S -> W.U64 & S, s: S, +n: Nat) -> Nat & S:
214  intn_z(~S, ~next, s, n, Nat.is_eq(n, 0n))

Uses (5)

Used by (3)