How Can I Convert Very Large Decimal Numbers to Binary In Java
问题 For instance, How would I be able to convert 2^60 or 12345678901234567890123456789012345678901234567890 to binary? Basically, numbers that are too large to represent in Java. Edit: I will be making a class that will be able to represent number that are too large. I'm just having a hard time figuring our how to convert decimal to binary. Edit2: And also, I am not allowed to use BigDecimal, BigInteger, or any other library, sorry for not specifying earlier. 回答1: Try this: new BigDecimal(