How do you convert A binary number to a BigInteger in Java?

后端 未结 3 1566
忘了有多久
忘了有多久 2021-01-04 02:09

I needed to convert a very big binary value into its decimal equivalent. As it is a big integer I was using BigInteger. So how do I convert this binary number to a BigIntege

3条回答
  •  清酒与你
    2021-01-04 02:38

        String binaryValue = "11111111";
        BigInteger bi = new BigInteger(binaryValue, 2);  
    

提交回复
热议问题