Bigint.Mag.sub: def of bend-kit-bignum@0.1.0.0 Import: import bend-kit-bignum@0.1.0.0/bigint.bend as Bigint Lines 90-99 of bend-kit-bignum@0.1.0.0/bigint.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-bignum@0.1.0.0/bigint.bend&start_line=90&end_line=99 import Base # a - b - w for a >= b + w. Leaves zero limbs on top: callers norm. def Mag.sub(a: List<&2, U32>, b: List<&2, U32>, +w: U32) -> List<&2, U32>: match a b: case Con{x, xs} Con{y, ys}: +t = (x + 10000 - y - w : U32) Con{(t % 10000 : U32), Mag.sub(xs, ys, (1 - t / 10000 : U32))} case s Nil{}: Mag.dec(s, U32.is_zero(w), w) case Nil{} s: Nil{} Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_zero https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mod https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=bend-kit-bignum@0.1.0.0/bigint.bend&name=Mag.dec