If the basic data types in Java cannot meet the requirements, you can use the biginteger and bigdecimal classes,
Biginteger commonly used functions include:
Biginteger add (biginteger value)
Biginteger multiply (biginteger value)
Biginteger divide (biginteger value)
Biginteger Mod (biginteger value)
Int compareto (biginteger value) // if the two big integers are the same, 0 is returned; otherwise, 1 is returned.
These two classes use the static valueof method to convert a common data type to a large value. However, this type cannot be operated using simple ++, but the member function must be used.
Two simple usage methods
biginteger A = biginteger. valueof ( 520 )
biginteger C. a. add (B): /// C = A + B, A and B must both be big integers.
bigdecimal and biginteger have similar usage, can refer to javadoc learning
reference materials
http://download.oracle.com/javase/1.4.2/docs/api/java/math/BigDecimal.html
http://download.oracle.com/javase/1.4.2/docs/api/java/math/BigInteger.html