The number is stored in int[] - the maximum size of the array is Integer.MAX_VALUE . So the maximum BigInteger is probably (2 ^ 32) ^ Integer.MAX_VALUE .
Admittedly, this is implementation dependent, not specification.
In Java 8, some information was added to the BigInteger javadoc , providing the minimum supported range and the actual limit of the current implementation:
BigInteger must support values โโin the range -2 Integer.MAX_VALUE (exclusive) to +2 Integer.MAX_VALUE (exception) and may support values โโoutside this range.
Implementation note: constructors and operations of BigInteger throw ArithmeticException when the result falls outside the supported range of -2 Integer.MAX_VALUE (exception) to +2 Integer.MAX_VALUE (exclusive).
assylias Oct 02 2018-12-12T00: 00Z
source share