RFR: 8341260: Add Float16 to jdk.incubator.vector [v16]

Eirik Bjørsnøs eirbjo at openjdk.org
Wed Nov 13 10:44:19 UTC 2024


On Wed, 13 Nov 2024 05:40:24 GMT, Joe Darcy <darcy at openjdk.org> wrote:

>> Port of Float16 from java.lang in the lworld+fp16 branch to jdk.incubabor.vector.
>
> Joe Darcy has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Implement code review feedback.
>  - Misc cleanups.

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float16.java line 150:

> 148:      * A constant holding the largest positive finite value of type
> 149:      * {@code Float16},
> 150:      * (2-2<sup>-10</sup>)·2<sup>15</sup>, numerically equal to 65504.0.

I'm curious why `MAX_VALUE` includes the "numerically equal to", while `MIN_NORMAL` and `MIN_VALUE` do not?

I see java.lang.Float does not use "numerically equal" in the corresponding constants.  Float instead says "It is equal to the hexadecimal floating-point literal.."

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21574#discussion_r1839952935


More information about the core-libs-dev mailing list