mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8202449: overflow handling in Random.doubles
Reviewed-by: darcy
This commit is contained in:
parent
c15e10fb6c
commit
c8cff1bd6f
5 changed files with 82 additions and 71 deletions
|
@ -540,10 +540,7 @@ public interface RandomGenerator {
|
|||
*
|
||||
* @throws IllegalArgumentException if {@code origin} is not finite,
|
||||
* or {@code bound} is not finite, or {@code origin}
|
||||
* is greater than or equal to {@code bound}, or
|
||||
* the difference between {@code bound} and {@code origin}
|
||||
* is so large that it cannot be represented as a finite
|
||||
* {@code float} value
|
||||
* is greater than or equal to {@code bound}
|
||||
*
|
||||
* @implSpec The default implementation verifies that the {@code origin}
|
||||
* and {@code bound} are valid then invokes {@code nextFloat()}
|
||||
|
@ -606,11 +603,8 @@ public interface RandomGenerator {
|
|||
*
|
||||
* @throws IllegalArgumentException if {@code origin} is not finite,
|
||||
* or {@code bound} is not finite, or {@code origin}
|
||||
* is greater than or equal to {@code bound}, or
|
||||
* the difference between {@code bound} and {@code origin}
|
||||
* is so large that it cannot be represented as a finite
|
||||
* {@code double} value
|
||||
*
|
||||
* is greater than or equal to {@code bound}
|
||||
|
||||
* @implSpec The default implementation verifies that the {@code origin}
|
||||
* and {@code bound} are valid, then invokes {@code nextDouble()}
|
||||
* scaling and translating the result to fit between {@code origin}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue