Skip to content

Rose::BitOps::shiftRightSigned

Right shift replicating MSB.

Synopsis

Declared in <src/Rose/BitOps.h>

template<typename Unsigned>
Unsigned
shiftRightSigned(
    Unsigned src,
    size_t n);

Description

Shift all bits of the value right (to lower indices) by n. The n low‐order bits are discarded and the new n high‐order bits are set or cleared depending on the original most significant bit. If n is greater than or equal to the size of src then the return value has either all bits set or all bits cleared depending on its original most significant bit.

Return Value

Shifted value.

Parameters

Name

Description

src

Input value.

n

Shift count.

Created with MrDocs