8281183: RandomGenerator:NextDouble() default behavior partially fixed by JDK-8280950

Reviewed-by: jlaskey
This commit is contained in:
Joe Darcy 2022-02-06 02:19:32 +00:00
parent 42e272e181
commit 77b0240d44
2 changed files with 7 additions and 4 deletions

View file

@ -677,7 +677,7 @@ public class RandomSupport {
double r = rng.nextDouble();
r = r * bound;
if (r >= bound) // may need to correct a rounding problem
r = Math.nextDown(r);
r = Math.nextDown(bound);
return r;
}