JDK 11 RFR of JDK-8202563: BigInteger/BigDecimal not immune to overflow, contrary to spec (original) (raw)

joe darcy joe.darcy at oracle.com
Tue May 8 04:47:28 UTC 2018


Hello,

Over in BigInteger, 2^Integer.MAX_VALUE just isn't as effectively infinite as it used to be. Please review the spec changes and CSR below to clarify that the range of BigInteger is "arbitrarily large" but not "infinite":

    JDK-8202563: BigInteger/BigDecimal not immune to overflow, contrary to spec     webrev: http://cr.openjdk.java.net/~darcy/8202563.0/     CSR: https://bugs.openjdk.java.net/browse/JDK-8202761

Patch below.

Thanks,

-Joe

--- old/src/java.base/share/classes/java/math/BigInteger.java 2018-05-07 21:39:33.679361845 -0700 +++ new/src/java.base/share/classes/java/math/BigInteger.java 2018-05-07 21:39:33.139361869 -0700 @@ -52,18 +52,15 @@   * and a few other miscellaneous operations.   *   *

Semantics of arithmetic operations exactly mimic those of Java's integer



More information about the core-libs-dev mailing list