Integrated: JDK-8283084 RandomGenerator nextDouble(double, double) is documented incorrectly
Jim Laskey
jlaskey at openjdk.java.net
Thu Apr 21 13:48:27 UTC 2022
On Tue, 5 Apr 2022 14:05:57 GMT, Jim Laskey <jlaskey at openjdk.org> wrote:
> `default float nextFloat(float origin, float bound); ` and `default double nextDouble(double origin, double bound); ` are documented incorrectly. The default method checks (origin < bound) and (bound - origin) < +infinity.
>
> The exception conditions are incorrect:
> "if {@code origin} is not finite,
> or {@code bound} is not finite, or {@code origin}
> is greater than or equal to {@code bound}"
>
> This is not true. Calling with -Double.MAX_VALUE and Double.MAX_VALUE satisfies the documented requirements but actually throws an exception.
This pull request has now been integrated.
Changeset: 85641c65
Author: Jim Laskey <jlaskey at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/85641c651d1099adcdce6ae355d8d89cfbd7e040
Stats: 18 lines in 1 file changed: 4 ins; 0 del; 14 mod
8283084: RandomGenerator nextDouble(double, double) is documented incorrectly
Reviewed-by: bpb, darcy
-------------
PR: https://git.openjdk.java.net/jdk/pull/8109
More information about the core-libs-dev
mailing list