8288173: JDK-8202449 fix causes conformance test failure : api/java_util/Random/RandomGenerator/NextFloat.html
Reviewed-by: bpb, darcy
This commit is contained in:
parent
f2e10dce78
commit
da2339cf69
@ -733,7 +733,7 @@ public class RandomSupport {
|
||||
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;
|
||||
}
|
||||
@ -765,7 +765,7 @@ public class RandomSupport {
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user