binary: Binary digit.

Description Usage Arguments Details Value See Also Examples

Description

Create objects of type binary.

Usage

1
binary(n, signed=FALSE, littleEndian=FALSE)

Arguments

n

length of vector. Number of bits

signed

TRUE or FALSE. Unsigned by default. (two's complement)

littleEndian

if TRUE. Big Endian if FALSE.

Details

The binary number is represented by a logical vector. The bit order usually follows the same endianess as the byte order. How to read:

The Big Endian endianess stores its MSB at the lowest adress. The Little Endian endianess stores its MSB at the highest adress.

e.g. b <-binary(8).

No floating-point support.

Value

a vector of class binary of length n. By default filled with zeros(0).

See Also

as.binary and is.binary.

Examples

1
2
3
4
5
6
b <- binary(8)
summary(b)
b <- binary(16, signed=TRUE)
summary(b)
b <- binary(32, littleEndian=TRUE)
summary(b)

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