def Big.add

bend-kit-fmt@0.1.0.0 · fmt.bend:142

import bend-kit-fmt@0.1.0.0/fmt.bend as Fmt
import Base

142def Big.add(a: List<&2, U32>, b: List<&2, U32>, c: U32) -> List<&2, U32>:
143  match a b:
144    case Con{x, xs} Con{y, ys}:
145      +t = {U32.add(U32.add(x, y), c) : U32}
146      Con{U32.and(t, 65535), Big.add(xs, ys, U32.shrn(t, 16n))}
147    case _ _:
148      Nil{}

Uses (5)

Used by (1)