def Mag.mul1

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

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

122# a * m + c for m, c below 10^4.
123def Mag.mul1(a: List<&2, U32>, +m: U32, +c: U32) -> List<&2, U32>:
124  match a:
125    case Nil{}:
126      Mag.lone(U32.is_zero(c), c)
127    case Con{x, xs}:
128      +t = (x * m + c : U32)
129      Con{(t % 10000 : U32), Mag.mul1(xs, m, (t / 10000 : U32))}

Uses (8)

Used by (2)