def div_small_signed

bend-collections-laws-crypto@1.0.0.0 · src/math/u64.bend:97

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

97# Signed a / d truncated toward zero (C semantics), for 0 < d <= 2^20.
98def div_small_signed(a: U64, +d: U32) -> U64:
99  U64{lo, +hi} = a
100  div_sign(U64{lo, hi}, d, U32.is_ge(hi, 2147483648))

Uses (4)

Used by (3)