def multiply_right

stelliferous@0.0.2.0 · math_checked_word.bend:34

import stelliferous@0.0.2.0/math_checked_word.bend as MathCheckedWord
import Base
import stelliferous@0.0.2.0/machine_limits.bend as Machine

34# Unit products already fit a word. Shapes and contiguous strides frequently
35# use them; returning the operand avoids the 32-step natural Horner traversal.
36def multiply_right(unit: Bool,left: U32,right: U32) -> Maybe<&2,U32>:
37  match unit:
38    case True{}: Some{left}
39    case False{}: multiply_bounded(left,right,Machine.word_max())

Uses (5)

Used by (1)