| binaryRep {SoDA} | R Documentation |
Functions to generate a binary representation from numeric data, as an example of vectorizing computations.
binaryRep(data, m = .Machine$double.digits) binaryRepA(m) binaryRepBits(data) binaryRepPowers(n, m)
data |
numeric data |
m |
number of bits in mantissa |
n |
range for powers |
The main function, binaryRep returns an object from class "binaryRep" providing the components of
the representation of data, as well as the original data
itself.
The other functions are helper functions; see the examples in the book.
The object returned
original:"numeric" sign, exponent:"integer" for the sign and exponent. bits:"raw" for the significand. binaryRep(c(.1, .25, 1/3))