How to add two numbers of any length in java?

后端 未结 8 1233
广开言路
广开言路 2020-12-06 01:20

How to add two numbers of any length in java?

Say for example, in java long size is 64 bit. So the maximum range is -9223372036854775808 to 9223372036854775807. Am i

8条回答
  •  被撕碎了的回忆
    2020-12-06 01:53

    Check out the BigInteger class. It will be able to perform the operations you are looking for on really large numbers.

    http://download.oracle.com/javase/1.4.2/docs/api/java/math/BigInteger.html

提交回复
热议问题