The OpenD Programming Language

UInt.smallLeftShift

Shifts left using at most size_t.sizeof * 8 - 1 bits

struct UInt(size_t size)
const
UInt!size
smallLeftShift
(
uint shift
)
if (
size % (size_t.sizeof * 8) == 0 &&
size >= size_t.sizeof * 8
)

Examples

auto a = UInt!128.fromHexString("afbbfae3cd0aff2714a1de7022b0029d");
assert(a.smallLeftShift(4) == UInt!128.fromHexString("fbbfae3cd0aff2714a1de7022b0029d0"));

Meta