My colleague Louis Wasserman reports:
Random.doubles(lowerBound, upperBound) does not behave gracefully in the presence of overflow -- specifically including when lowerBound or upperBound have magnitude in the range of Double.MAX_VALUE.
There is a relatively simple patch: if (upperBound - lowerBound >= Double.MAX_VALUE), return a double in the range [lowerBound/2, upperBound/2) and multiply it by 2.
Random.doubles(lowerBound, upperBound) does not behave gracefully in the presence of overflow -- specifically including when lowerBound or upperBound have magnitude in the range of Double.MAX_VALUE.
There is a relatively simple patch: if (upperBound - lowerBound >= Double.MAX_VALUE), return a double in the range [lowerBound/2, upperBound/2) and multiply it by 2.
- csr for
-
JDK-8287026 Changes related to overflow handling in Random.doubles
-
- Closed
-
- relates to
-
JDK-8288173 JDK-8202449 fix causes conformance test failure : api/java_util/Random/RandomGenerator/NextFloat.html
-
- Resolved
-
-
JDK-8288288 JDK-8202449 fix breaks RandomGenerator.html#nextDouble(double,double) conformance spec for IAEx case
-
- Closed
-