shiftLeft: Binary Left Shift (<<)

Description Usage Arguments Value See Also Examples

Description

Logical left shift x << n

Usage

1
shiftLeft(x, n)

Arguments

x

The binary number to shift. (binary or logical vector).

n

The number of bits to shift.

Value

Pushes 0's(FALSE) to the vector from right(LSB) to left(MSB). Everything on right(MSB) side drops out. Returns a binary/logical vector

See Also

shiftRight and rotate

Examples

1
2
3
x <- as.binary(c(1,0,0,1,1,1,0,1), logic=TRUE); x
shiftLeft(x,1)
shiftLeft(x,2)

Example output

[1] 1 0 0 1 1 1 0 1
[1] 0 0 1 1 1 0 1 0
[1] 0 1 1 1 0 1 0 0

binaryLogic documentation built on May 2, 2019, 10:25 a.m.