Possible Duplicate:
What does BigInteger having no limit mean?
The Javadoc for BigInteger does not define any maximum or minimum. However, it does say:
(emphasis added)
Immutable arbitrary-precision integers
Is there such a maximum, even in theory? Or is the way BigInteger operates fundamentally different, such that there is in reality no maximum except for the amount of memory available on the computer?
The number is held in an
int[]– the maximum size of an array isInteger.MAX_VALUE. So the maximum BigInteger probably is(2 ^ 32) ^ Integer.MAX_VALUE.Admittedly, this is implementation dependent, not part of the specification.
In Java 8, some information was added to the BigInteger javadoc, giving a minimum supported range and the actual limit of the current implementation: