binAdd: Binary Addition (+)

Description Usage Arguments Details Value See Also Examples

Description

Adds two binary numbers. (x + y)

Usage

1
binAdd(x, y)

Arguments

x

summand 1 (binary vector)

y

summand 2 (binary vector)

Details

Little-Endian and unsigned is not supported at the moment. No floating point supported. if x or y is signed the return value will also be signed.

Value

The sum of x and y. Returns a binary vector.

See Also

base::as.logical , base::is.logical, base::raw

Examples

1
2
3
five <- as.binary(5); ten <- as.binary(10);
as.numeric(binAdd(ten, five))
binAdd(as.binary(c(0,1), logic=TRUE), as.binary(c(1,0), logic=TRUE))

d4ndo/binaryLogic documentation built on May 14, 2019, 3:05 p.m.