Skip to content

Commit

Permalink
8288173: JDK-8202449 fix causes conformance test failure : api/java_u…
Browse files Browse the repository at this point in the history
…til/Random/RandomGenerator/NextFloat.html

Backport-of: da2339c
  • Loading branch information
jddarcy committed Jun 11, 2022
1 parent d9c1364 commit f4b05a1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ public static float boundedNextFloat(RandomGenerator rng, float origin, float bo
r = (r * (0.5f * bound - halfOrigin) + halfOrigin) * 2.0f;
}
if (r >= bound) // may need to correct a rounding problem
r = Math.nextDown(r);
r = Math.nextDown(bound);
}
return r;
}
Expand Down Expand Up @@ -765,7 +765,7 @@ public static float boundedNextFloat(RandomGenerator rng, float bound) {
float r = rng.nextFloat();
r = r * bound;
if (r >= bound) // may need to correct a rounding problem
r = Math.nextDown(r);
r = Math.nextDown(bound);
return r;
}

Expand Down

0 comments on commit f4b05a1

Please sign in to comment.