RFR: 8273514: java/util/DoubleStreamSums/CompensatedSums.java failure [v2]
Ian Graves
igraves at openjdk.java.net
Mon Sep 13 16:28:18 UTC 2021
On Mon, 13 Sep 2021 00:08:20 GMT, Joe Darcy <darcy at openjdk.org> wrote:
>> Ian Graves has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Tweaking asserts
>
> test/jdk/java/util/DoubleStreamSums/CompensatedSums.java line 87:
>
>> 85: badParallelStreamError += Math.pow(computeFinalSum(DoubleStream.of(rand).parallel().collect(doubleSupplier,objDoubleConsumer,badCollectorConsumer)) - sum[0], 2);
>> 86:
>> 87:
>
> Above, if there are going to be multiple uese of Math.pow(arg, 2) in the test, I recommend defining a local private static square(double d) method for this test where square is
> double square(double arg) {return arg * arg;}
> The library method pow(arg, 2) does a check for the exponent being two and does a multiple instead.
Good call. Done.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5430
More information about the core-libs-dev
mailing list