powered by
Logical left shift x << n
shiftLeft(x, n)
The binary number to shift. (binary or logical vector).
The number of bits to shift.
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
shiftRight and rotate
# NOT RUN { x <- as.binary(c(1,0,0,1,1,1,0,1), logic=TRUE); x shiftLeft(x,1) shiftLeft(x,2) # }
Run the code above in your browser using DataLab