RFR: JDK-8280550: SplittableRandom#nextDouble(double, double) can return result >= bound
Jim Laskey
jlaskey at openjdk.java.net
Wed Jan 26 13:42:30 UTC 2022
On Wed, 26 Jan 2022 02:12:11 GMT, Joe Darcy <darcy at openjdk.org> wrote:
> Use floating-point library methods to nudge down the result if needed. The nextAfter(r, origin) call return the next value in the direction of origin, handling cases for negative values, etc.
>
> Changing to call nextDown for the origin is bounded at zero is just a refactoring that is clearer to read IMO.
>
> The regression test fails on an unpatched JDK.
LGTM
-------------
Marked as reviewed by jlaskey (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/7221
More information about the core-libs-dev
mailing list