def Mag.add

bend-kit-bignum@0.1.0.0 · bigint.bend:68

import bend-kit-bignum@0.1.0.0/bigint.bend as Bigint
import Base

68def Mag.add(a: List<&2, U32>, b: List<&2, U32>, +c: U32) -> List<&2, U32>:
69  match a b:
70    case Con{x, xs} Con{y, ys}:
71      +t = (x + y + c : U32)
72      Con{(t % 10000 : U32), Mag.add(xs, ys, (t / 10000 : U32))}
73    case Nil{} s:
74      Mag.inc(s, U32.is_zero(c), c)
75    case s Nil{}:
76      Mag.inc(s, U32.is_zero(c), c)

Uses (7)

Used by (4)