bitops (version 1.0-6)

bitShiftL: Bitwise Shift Operator (to the Left or Right)

Description

Shifting integers bitwise to the left or to the right.

Usage

bitShiftL(a, b)
bitShiftR(a, b)

Arguments

a

numeric vector (integer valued), to be shifted.

b

integer vector

Value

numeric vector of the maximum length as a or b containing the value of a shifted to the left or right by b bits. NA is returned wherever the value of a or b is not finite, or, wherever the magnitude of a is greater than or equal to \(2^{32}\).

See Also

bitFlip, bitXor, etc.

Examples

Run this code
# NOT RUN {
  bitShiftR(-1,1) == 2147483647
  bitShiftL(2147483647,1) == 4294967294
  bitShiftL(-1,1) == 4294967294
# }

Run the code above in your browser using DataCamp Workspace