Re: RFR: 8285477: Add a PRECISION public static field to j.l.Float and j.l.Double [v3]

2022-04-22 Thread Joe Darcy
On Fri, 22 Apr 2022 17:36:26 GMT, Raffaello Giulietti  
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

Marked as reviewed by darcy (Reviewer).

-

PR: https://git.openjdk.java.net/jdk/pull/8362


Re: RFR: 8285477: Add a PRECISION public static field to j.l.Float and j.l.Double [v2]

2022-04-22 Thread Raffaello Giulietti
On Fri, 22 Apr 2022 16:34:46 GMT, Joe Darcy  wrote:

>> 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

Ready

> 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:  * The Java Language Specification.
> 
> Please use "cite" rather than "em" tags for references to the JLS.

Ready

-

PR: https://git.openjdk.java.net/jdk/pull/8362


Re: RFR: 8285477: Add a PRECISION public static field to j.l.Float and j.l.Double [v3]

2022-04-22 Thread Raffaello Giulietti
> 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

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8362/files
  - new: https://git.openjdk.java.net/jdk/pull/8362/files/80a6fe2e..b4c1b61b

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=8362&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=8362&range=01-02

  Stats: 6 lines in 2 files changed: 0 ins; 0 del; 6 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8362.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8362/head:pull/8362

PR: https://git.openjdk.java.net/jdk/pull/8362


Re: RFR: 8285477: Add a PRECISION public static field to j.l.Float and j.l.Double [v2]

2022-04-22 Thread Joe Darcy
On Fri, 22 Apr 2022 14:38:06 GMT, Raffaello Giulietti  
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:  * The Java Language Specification.

Please use "cite" rather than "em" tags for references to the JLS.

-

PR: https://git.openjdk.java.net/jdk/pull/8362


Re: RFR: 8285477: Add a PRECISION public static field to j.l.Float and j.l.Double [v2]

2022-04-22 Thread Raffaello Giulietti
> 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

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8362/files
  - new: https://git.openjdk.java.net/jdk/pull/8362/files/830faf2b..80a6fe2e

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=8362&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=8362&range=00-01

  Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8362.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8362/head:pull/8362

PR: https://git.openjdk.java.net/jdk/pull/8362


Re: RFR: 8285477: Add a PRECISION public static field to j.l.Float and j.l.Double

2022-04-22 Thread Raffaello Giulietti
On Fri, 22 Apr 2022 14:26:07 GMT, Raffaello Giulietti  
wrote:

> Add useful constants specified in IEEE 754.

The precision of float resp. double values, as defined by IEEE 754, is not 
easily derivable from the constants in the java.lang.Float resp. 
java.lang.Double classes. These values (24 resp. 53) are used in some places in 
the OpenJDK code base, where they appear as literals or even as derived 
literals, like 23 and 52. Hence, usages of these values are harder to find than 
necessary.

-

PR: https://git.openjdk.java.net/jdk/pull/8362


RFR: 8285477: Add a PRECISION public static field to j.l.Float and j.l.Double

2022-04-22 Thread Raffaello Giulietti
Add useful constants specified in IEEE 754.

-

Commit messages:
 - 8285477: Add a PRECISION public static field to j.l.Float and j.l.Double

Changes: https://git.openjdk.java.net/jdk/pull/8362/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8362&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8285477
  Stats: 50 lines in 2 files changed: 32 ins; 14 del; 4 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8362.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8362/head:pull/8362

PR: https://git.openjdk.java.net/jdk/pull/8362