def thresh
import bend-collections@1.0.0.0/src/math/random/rand.bend as Randimport Base
import bend-collections@1.0.0.0/src/math/u64.bend as W
import bend-collections@1.0.0.0/src/math/w64.bend as X
103# 2^64 mod n = (2^64 - n) mod n, for n > 0 (Go: -n % n)
104def thresh(+n: W.U64) -> W.U64:
105 X.rem(X.sub(W.U64{0, 0}, n), n)