I have large integers that I need to convert to binary, but I keep getting this warning message:
Warning messages:
- In
h(num)
: probable complete loss of accuracy in modulus 2: - In
diff(x%%2^(num_digits:0))
: probable complete loss of accuracy in modulus
I have figured out that it's because converting a number to binary essentially is just dividing by two and determining if there is a remainder a whole bunch of times and R has a maximum number of digits that it is able to work with without losing the information at the end. Any suggestions on how to remedy this?
Example code:
library(binaryLogic)
as.binary(13256712356712312361)
[1] 1 0 1 1 0 1 1 1 1 1 1 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 1 1 1 1 0 1 0 1 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
Warning messages:
- In
h(num)
: probable complete loss of accuracy in modulus - In
diff(x%%2^(num_digits:0))
: probable complete loss of accuracy in modulus