def u32_wrapping_shl

bend-collections-laws-math@1.0.0.0 · src/math/fixed.bend:146

import bend-collections-laws-math@1.0.0.0/src/math/fixed.bend as Fixed
import Base
import bend-collections-laws-math@1.0.0.0/src/math/w64.bend as X

146# shifts by s mod 32 (Rust masks the amount the same way); a left shift is
147# the product with 2^k modulo 2^32
148def u32_wrapping_shl(+a: U32, +s: U32) -> U32:
149  U32.mul(a, X.pow2(U32.to_nat(U32.and(s, 31))))

Uses (5)

Used by (4)