Generic.submod: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/src/math/generic.bend as Generic Lines 553-559 of bend-collections-laws-crypto@1.0.0.0/src/math/generic.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/src/math/generic.bend&start_line=553&end_line=559 import Base import bend-collections-laws-crypto@1.0.0.0/src/math/num.bend as N # s0 - x mod m for s0, x < m, without leaving [0, m) def submod(~T: Data, ~op: N.Op -> T, +m: T, +s0: T, +x: T, below: Bool) -> T: match below: case False{}: op(N.Sub{s0, x}) case True{}: op(N.Add{s0, op(N.Sub{m, x})}) Uses (2): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/math/num.bend&name=Op