rotate {binaryLogic}R Documentation

Rotate no carry ()

Description

A circular shift

Usage

rotate(x, n)

Arguments

x

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

n

The number of bits to rotate.

Value

rotates the vector from left to right. The value from MSB is used to fill up the vector at LSB. Returns a binary/logical vector.

See Also

shiftLeft and shiftRight

Examples

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

[Package binaryLogic version 0.3.9 Index]