def div_small

bend-collections@1.0.0.0 · src/math/u64.bend:85

import bend-collections@1.0.0.0/src/math/u64.bend as U64
import Base

85# Unsigned a / d, for 0 < d <= 2^20.
86def div_small(a: U64, +d: U32) -> U64:
87  U64{+lo, +hi} = a
88  div_t2(lo, hi, d, U32.add(U32.mul(U32.mod(hi, d), 4096), U32.div(lo, 1048576)))

Uses (7)

Used by (1)