def draw_pos

bend-collections-laws-math@1.0.0.0 · spec/math/random/rand.bend:63

import bend-collections-laws-math@1.0.0.0/spec/math/random/rand.bend as Rand
import Base
import bend-collections-laws-math@1.0.0.0/spec/lib/common.bend as C

63def draw_pos(+w: Nat, +x: Nat, +n: Nat, +m: Nat, pow2: Bool) -> Maybe<&2, Nat>:
64  match pow2:
65    case True{}:
66      Some{and_bits(w, x, m)}
67    case False{}:
68      lemire(w, n, C.high(w, Nat.mul(x, n)), C.low(w, Nat.mul(x, n)))

Uses (8)

Used by (4)