RFR: 8326227: Rounding error that may distort computeNextGaussian results [v3]

Chris Hennick duke at openjdk.org
Fri Aug 9 22:51:54 UTC 2024


On Wed, 12 Jun 2024 09:35:12 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> Chris Hennick has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Bug fix: add-exports was for wrong package
>
> test/jdk/jdk/internal/util/random/RandomSupportTest.java line 32:
> 
>> 30:         for (double max = 1.0; max < 10.0; max++) {
>> 31:             WorstCaseRandomGenerator rng = new WorstCaseRandomGenerator();
>> 32:             assertTrue(RandomSupport.computeNextExponentialSoftCapped(rng, max) >= max);
> 
> Would you mind changing this to something like:
> 
> double val = RandomSupport.computeNextExponentialSoftCapped(rng, max);
> System.out.println("got " + val + " for max " + max);
> assertTrue(val >= max, val + " isn't >= " + max);
> 
> 
> That way if this test fails for any reason, then we get the necessary details on what the computed value is.

Done.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/17703#discussion_r1712323293


More information about the core-libs-dev mailing list