Skip to main content

rotate_left

Function rotate_left 

Source
pub open spec fn rotate_left(x: i128, n: u32) -> i128
Expand description
{ if n % 128u32 == 0 { x } else { u128_specs::rotate_left(x as u128, n) as i128 } }

Rotates the two’s-complement bits of x, as the unsigned rotate_left does. A rotation by a multiple of BITS is x directly, so that case needs no reasoning about the casts.