Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.
/ jdk19 Public archive

Commit f4b05a1

Browse files
committed
8288173: JDK-8202449 fix causes conformance test failure : api/java_util/Random/RandomGenerator/NextFloat.html
Backport-of: da2339c
1 parent d9c1364 commit f4b05a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/java.base/share/classes/jdk/internal/util/random/RandomSupport.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ public static float boundedNextFloat(RandomGenerator rng, float origin, float bo
733733
r = (r * (0.5f * bound - halfOrigin) + halfOrigin) * 2.0f;
734734
}
735735
if (r >= bound) // may need to correct a rounding problem
736-
r = Math.nextDown(r);
736+
r = Math.nextDown(bound);
737737
}
738738
return r;
739739
}
@@ -765,7 +765,7 @@ public static float boundedNextFloat(RandomGenerator rng, float bound) {
765765
float r = rng.nextFloat();
766766
r = r * bound;
767767
if (r >= bound) // may need to correct a rounding problem
768-
r = Math.nextDown(r);
768+
r = Math.nextDown(bound);
769769
return r;
770770
}
771771

0 commit comments

Comments
 (0)