Integrated: JDK-8280550: SplittableRandom#nextDouble(double,double) can return result >= bound
Joe Darcy
darcy at openjdk.java.net
Wed Jan 26 17:29:42 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.
This pull request has now been integrated.
Changeset: 0c42e43f
Author: Joe Darcy <darcy at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/0c42e43f77b91a50fedc3fddb74e17f910d8df2a
Stats: 54 lines in 2 files changed: 52 ins; 0 del; 2 mod
8280550: SplittableRandom#nextDouble(double,double) can return result >= bound
Reviewed-by: jlaskey, psandoz
-------------
PR: https://git.openjdk.java.net/jdk/pull/7221
More information about the core-libs-dev
mailing list