Learn R Programming

bitops (version 1.0-4.2)

bitAnd: Bitwise And, Or and Xor operations

Description

returns the bitwise operation applied to the arguments

Usage

bitAnd(a, b)
bitOr (a, b)
bitXor(a, b)

Arguments

a,b
numeric vectors of compatible length.

Value

  • numeric vector of maximum length of a or b.

Details

The bitwise operations are applied to the arguments cast as 32 bit (unigned long) integers. NA is returned wherever the magnitude of the arguments is not less than 2**31, or, where either of the arguments is not finite.

Examples

Run this code
bitAnd(15,7) == 7
	bitOr(15,7) == 15
	bitXor(15,7) == 8
	bitOr(-1,0) == 4294967295

Run the code above in your browser using DataLab