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

Joe Darcy darcy at openjdk.org
Wed Nov 13 18:24:17 UTC 2024


On Wed, 13 Nov 2024 11:15:15 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

>> 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.."
>
> Not sure if this is the reason, but in decimal notation `MIN_NORMAL` and `MIN_VALUE` are relatively unreadable: `0.00006103515625` and `5.9604644775390625E-8`, resp.

Yes, that was the reason; the other constants written out aren't particularly informative to most users.

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

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


More information about the core-libs-dev mailing list