mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8280950: RandomGenerator:NextDouble() default behavior non conformant after JDK-8280550 fix
Reviewed-by: bpb, jlaskey
This commit is contained in:
parent
1ea01465ab
commit
0e70d4504c
2 changed files with 42 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -645,7 +645,7 @@ public class RandomSupport {
|
|||
if (origin < bound) {
|
||||
r = r * (bound - origin) + origin;
|
||||
if (r >= bound) // may need to correct a rounding problem
|
||||
r = Math.nextAfter(r, origin);
|
||||
r = Math.nextAfter(bound, origin);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue