Bigint.Mag.inc: def of bend-kit-bignum@0.1.0.0 Import: import bend-kit-bignum@0.1.0.0/bigint.bend as Bigint Lines 56-66 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=56&end_line=66 import Base # The limbs are 0 or 1 in z: z says the carry c is 0, so a stays as is. def Mag.inc(a: List<&2, U32>, z: Bool, +c: U32) -> List<&2, U32>: match a z: case s True{}: s case Nil{} False{}: Con{c, Nil{}} case Con{x, xs} False{}: +t = (x + c : U32) +k = (t / 10000 : U32) Con{(t % 10000 : U32), Mag.inc(xs, U32.is_zero(k), k)} Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool 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