def signed_quotient
import bend-collections-laws-math@1.0.0.0/spec/math/u64.bend as U64import Base
import bend-collections-laws-math@1.0.0.0/spec/lib/numeric.bend as N
24# the quotient of a signed word: rounded toward zero, as the magnitude's
25def signed_quotient(w: Word(64n), neg: Bool, +d: U32) -> Word(64n):
26 match neg:
27 case False{}:
28 N.unsigned_quotient(64n, w, d)
29 case True{}:
30 N.negative_quotient(64n, w, d)