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
Use BigInteger. Here is an example.
Example code (based on above link) -
BigInteger reallyBig1 = new BigInteger("1234567890123456890"); BigInteger reallyBig2 = new BigInteger("2743534343434361234"); reallyBig = reallyBig.add(reallyBig2);