def BigInt.add.mixed
import bend-kit-bignum@0.1.0.0/bigint.bend as Bigintimport Base
382# Signs differ: the larger magnitude keeps its sign.
383def BigInt.add.mixed(c: Cmp, +sa: Bool, x: List<&2, U32>, y: List<&2, U32>) ->
384 BigInt:
385 match c:
386 case LT{}:
387 BigInt.mk(Bool.not(sa), Mag.norm(Mag.sub(y, x, 0)))
388 case EQ{}:
389 BigInt.zero()
390 case GT{}:
391 BigInt.mk(sa, Mag.norm(Mag.sub(x, y, 0)))