RFR: 8285477: Add a PRECISION public static field to j.l.Float and j.l.Double [v2]
Joe Darcy
darcy at openjdk.java.net
Fri Apr 22 16:41:18 UTC 2022
On Fri, 22 Apr 2022 14:38:06 GMT, Raffaello Giulietti <duke at openjdk.java.net> wrote:
>> Add useful constants specified in IEEE 754.
>
> Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision:
>
> 8285477: Add a PRECISION public static field to j.l.Float and j.l.Double
src/java.base/share/classes/java/lang/Double.java line 231:
> 229: * @since 1.6
> 230: */
> 231: public static final int MAX_EXPONENT = (1 << (SIZE - PRECISION - 1)) - 1;
Please include the expected value as a comment; e.g.
(1 << (SIZE - PRECISION - 1)) - 1; // 1023
src/java.base/share/classes/java/lang/Float.java line 128:
> 126: * The number of bits in the significand of a {@code float} value.
> 127: * This is the parameter N in section {@jls 4.2.3} of
> 128: * <em>The Java Language Specification</em>.
Please use "cite" rather than "em" tags for references to the JLS.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8362
More information about the core-libs-dev
mailing list