I want to convert a binary string of width 64 to long, there is a static method:
Long.parseLong(String s, int radix)
but this is not suitable for my case.
The problem is that my binary string is a long int.
For example:
1111111111111111111111111111111111111111111111111111111110000101
represents -123
, but this method recognizes this as a huge positive number, it bothers me, how can I solve this problem?
Should I write a function that performs the addition?
Sefier tang
source share