8283084: RandomGenerator nextDouble(double, double) is documented incorrectly
Reviewed-by: bpb, darcy
This commit is contained in:
parent
4732b1d038
commit
85641c651d
@ -539,13 +539,15 @@ 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}
|
||||
* 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
|
||||
*
|
||||
* @implSpec The default implementation checks that {@code origin} and
|
||||
* {@code bound} are positive finite floats. Then invokes
|
||||
* {@code nextFloat()}, scaling and translating the result so that the final
|
||||
* result lies between {@code origin} (inclusive) and {@code bound}
|
||||
* (exclusive).
|
||||
* @implSpec The default implementation verifies that the {@code origin}
|
||||
* and {@code bound} are valid then invokes {@code nextFloat()}
|
||||
* scaling and translating the result to fit between {@code origin}
|
||||
* and {@code bound} (exclusive).
|
||||
*/
|
||||
default float nextFloat(float origin, float bound) {
|
||||
RandomSupport.checkRange(origin, bound);
|
||||
@ -603,13 +605,15 @@ 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}
|
||||
* 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
|
||||
*
|
||||
* @implSpec The default implementation checks that {@code origin} and
|
||||
* {@code bound} are positive finite doubles. Then calls
|
||||
* {@code nextDouble()}, scaling and translating the result so that the final
|
||||
* result lies between {@code origin} (inclusive) and {@code bound}
|
||||
* (exclusive).
|
||||
* @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}
|
||||
* and {@code bound}( exclusive).
|
||||
*/
|
||||
default double nextDouble(double origin, double bound) {
|
||||
RandomSupport.checkRange(origin, bound);
|
||||
|
Loading…
x
Reference in New Issue
Block a user