Skip to main content

mask

Function mask 

Source
pub fn mask(value: i32, width: u32) -> i16
Expand description

Mask and sign-interpret an integer to width bits (branchless).

width must be in 1..=32. Values outside this range trigger a debug assertion failure (release builds silently produce garbage).