def scale_binary

bend-collections-laws-crypto@1.0.0.0 · spec/lib/numeric.bend:86

import bend-collections-laws-crypto@1.0.0.0/spec/lib/numeric.bend as Numeric
import Base

86# Mathematical multiplication by 2^places, specified without machine shifts.
87def scale_binary(places: Nat, value: Nat) -> Nat:
88  match places:
89    case 0n:
90      value
91    case 1n+p:
92      Nat.double(scale_binary(p, value))

Uses (2)

Used by (1)