Skip to main content

sign_extend_be_fixed

Function sign_extend_be_fixed 

Source
pub fn sign_extend_be_fixed<const W: usize, const N: usize>(
    b: &[u8; W],
) -> [u8; N]
Expand description

Sign extends b, a big-endian two’s complement value of W bytes, to N bytes.

Equivalent to sign_extend_be for a width known at compile time, which keeps the copy a constant-size move.