This package contains the binary S3 class. A data object can be instantiated to store a binary number(Base2).
It can be used to convert, negate, shift or rotate the binary number. (switchEndianess, bytesNeeded, binaryPrefix, fillUpToByte).
Binary operators:
== , != , < , <= , > , >=
+ , - , ^, *
& , | , xor (Logical Operator. Bitwise operation. The smaller vector is added up with zeros)
! (Indicates logical negation (NOT). Bitwise Operations)
binaryLogic functions:
shiftLeft(binary) , shiftRight(binary)
rotate(binary)
negate(binary)
switchEndianess(binary)
Additional function:
fillUpToByte, fillUpToBit
bytesNeeded
binaryPrefix
byte
This binary class is just not that great at heavy number crunching, but it brings some benefits. Especially if you like to work using vectors in R. It inherits from the logical class. Some function from package binaryLogic can be applied to logical vectors. Such as shift or rotate (see help).
The internal structure looks like this:
structure(c(TRUE, FALSE), class = c("binary", "logical"), signed = FALSE, littleEndian = FALSE)
It is composed of a logical vector and several attributes. This structure shows a big endian number, it corresponds to the value = 2 (Base10).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.