def borrow

bend-collections@1.0.0.0 · src/crypto/secp256k1/limbs.bend:180

import bend-collections@1.0.0.0/src/crypto/secp256k1/limbs.bend as Limbs
import Base

180# 1 when the value of xs is below the value of ys plus br, else 0 (the
181# borrow out of xs - ys - br), for lists of the same length
182def borrow(xs: List<&2, Nat>, ys: List<&2, Nat>, br: Nat) -> Nat:
183  match xs ys:
184    case x <> xt y <> yt: borrow(xt, yt, b2n(Nat.is_lt(x, Nat.add(br, y))))
185    case _ _: br

Uses (5)

Used by (1)