[lworld+fp16] RFR: 8339252: Add method float16Value() to BigInteger and BigDecimal [v2]
Raffaello Giulietti
rgiulietti at openjdk.org
Tue Sep 3 13:06:43 UTC 2024
On Tue, 3 Sep 2024 10:17:30 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:
>> Raffaello Giulietti has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase.
>
> test/jdk/java/math/BigInteger/PrimitiveConversionTests.java line 117:
>
>> 115: }
>> 116:
>> 117: BigInteger large = ONE.shiftLeft(1_000);
>
> Nit: we can be strict here, and pass a value slightly greater than MAX_VALUE + 0.5 * ULP(MAX_VALUE) i.e. 0x1.ffeP+15
> `BigInteger large = BigInteger.valueOf(0x1.ffeP+15)`
>
> Thereby avoiding shift left.
All integers between `-(MAX_VALUE + ULP(MAX_VALUE))` and `(MAX_VALUE + ULP(MAX_VALUE))` are tested in the loop, including `MAX_VALUE + 0.5 * ULP(MAX_VALUE)`.
But we also need a test for really big integers.
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1228#discussion_r1742028512
More information about the valhalla-dev
mailing list