Binary representation of integers with any number of bits (as high as 80 or more)

I want to calculate binary representation of integers. I did find functions in R such as, as.binary (from binaryLogic package) and intToBits (from Base R) which help in converting number into binary format. However these functions have some limitations:-
innToBits can give format in terms of 32 bits only
as.binary seems to be working well upto 2^53 i.e. as.binary(2^53-1, n=53) gives the required binary format of the number. However it's not working well beyond that.

I basically want to find a way to convert any number (it can go as high as 2^80) to its respective binary format. Is this possible in R? Any kind of guidance will really be helpful!

Thanks in advance! :slight_smile:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.