Skip to main content

rotate_right

Function rotate_right 

Source
pub open spec fn rotate_right(x: usize, n: u32) -> usize
Expand description
{
    let r = n % usize::BITS;
    if r == 0 { x } else { (x >> r) | (x << ((usize::BITS - r) as u32)) }
}

The bits of x shifted right by n % BITS, with the bits shifted out of the bottom moved into the top.