def w_go

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

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/w64.bend as X

181# the 32-bit word of the low 8k bits of n, a byte at a time
182def w_go(k: Nat, +n: Nat) -> U32:
183  match k:
184    case 0n:
185      0
186    case 1n+j:
187      U32.add(U32.from_nat(Nat.mod(n, 256n)), U32.mul(w_go(j, Nat.div(n, 256n)), X.pow2(8n)))

Uses (8)

Used by (3)