Skip to content

Rose::BitOps::shiftRightLsb

Right shift part of a value without affecting the rest.

Synopsis

Declared in <src/Rose/BitOps.h>

template<typename Unsigned>
Unsigned
shiftRightLsb(
    Unsigned src,
    size_t w,
    size_t n,
    bool b = false);

Description

The value src has its low‐order w bits shifted right toward lower order. The n lowest bits are discarded and the n new higher order bits are either set or cleared depending on b. If n is greater than or equal to w then all affected bits are set or cleared, depending on b. The bits not in the affected range are not affected and are returned.

Return Value

Updated value.

Parameters

Name

Description

src

Input value.

w

Width of the low‐order region.

n

Shift count.

b

Fill bit value.

Created with MrDocs