def divmod

bend-collections-laws-crypto@1.0.0.0 · src/math/natural.bend:333

import bend-collections-laws-crypto@1.0.0.0/src/math/natural.bend as Natural
import Base

333def divmod(+a: Nat, +b: Nat) -> Result<&2, &2, MathError, QuotRem>:
334  match b:
335    case 0n:
336      Fail{ZeroDivision{}}
337    case 1n+ +bp:
338      Done{QR{Nat.div(a, 1n+bp), Nat.mod(a, 1n+bp)}}

Uses (6)

Used by (5)