def div32

bend-collections-laws-crypto@1.0.0.0 · src/math/w64.bend:128

import bend-collections-laws-crypto@1.0.0.0/src/math/w64.bend as W64
import Base
import bend-collections-laws-crypto@1.0.0.0/src/math/u64.bend as W

128# (a / d, a mod d) for d > 0: the high word natively, the low word by digits
129def div32(+a: W.U64, +d: U32) -> W.U64 & U32:
130  div32_t1(U32.div(hi(a), d), lo(a), dig_t(U32.to_nat(U32.mod(hi(a), d)), 65536n, dig1(lo(a))), U32.to_nat(d))

Uses (11)

Used by (12)