Java Biginteger

When working with arithmetic operations using int or long

Java Biginteger

Java Biginteger

     

When working with arithmetic operations using int or long, if the value becomes larger than 64 bits which is the size of a long then java takes only the low order 32 (64 for longs) bits ignoring the rest. Just have an attention, here java doesn't generate any error but produce the result which is not correct. BigInteger in "java.math" package is made to store large results. It provides a number of methods for doing arithmetic with them.