Bitwise And, Or and Xor Operations

Description

Bitwise operations, ‘and’ (&), ‘or’ (|), and ‘Xor’ (xor).

Usage

1
2
3
bitAnd(a, b)
bitOr (a, b)
bitXor(a, b)

Arguments

a,b

numeric vectors of compatible length.

Details

The bitwise operations are applied to the arguments cast as 32 bit (unsigned 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.

Value

numeric vector of maximum length of a or b.

Author(s)

Steve Dutky

See Also

bitFlip, bitShiftL; further, cksum.

Examples

1
2
3
4
	bitAnd(15,7) == 7
	bitOr(15,7) == 15
	bitXor(15,7) == 8
	bitOr(-1,0) == 4294967295

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.