Create objects of type binary.
binary(n, signed=FALSE, littleEndian=FALSE)
length of vector. Number of bits
TRUE or FALSE. Unsigned by default. (two's complement)
if TRUE. Big Endian if FALSE.
a vector of class binary of length n. By default filled with zeros(0).
The binary number is represented by a logical vector. The bit order usually follows the same endianess as the byte order. How to read:
Little Endian (LSB) ---> (MSB)
Big Endian (MSB) <--- (LSB)
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).
"Little Endian" : MSB at b[1] and LSB at b[8].
"Big Endian" : LSB at b[1] and MSB at b[8].
No floating-point support.
b <- rdiversity:::binary(8)
summary(b)
#> Signedness Endianess value<0 Size[bit] Base10
#> 1 unsigned Big-Endian FALSE 8 0
b <- rdiversity:::binary(16, signed=TRUE)
summary(b)
#> Signedness Endianess value<0 Size[bit] Base10
#> 1 signed Big-Endian FALSE 16 0
b <- rdiversity:::binary(32, littleEndian=TRUE)
summary(b)
#> Signedness Endianess value<0 Size[bit] Base10
#> 1 unsigned Little-Endian FALSE 32 0