Rand.thresh: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/src/math/random/rand.bend as Rand Lines 103-105 of bend-collections-laws-crypto@1.0.0.0/src/math/random/rand.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/src/math/random/rand.bend&start_line=103&end_line=105 import Base import bend-collections-laws-crypto@1.0.0.0/src/math/u64.bend as W import bend-collections-laws-crypto@1.0.0.0/src/math/w64.bend as X # 2^64 mod n = (2^64 - n) mod n, for n > 0 (Go: -n % n) def thresh(+n: W.U64) -> W.U64: X.rem(X.sub(W.U64{0, 0}, n), n) Uses (3): https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/math/u64.bend&name=U64 https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/math/w64.bend&name=rem https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/math/w64.bend&name=sub