RFR: JDK-8283143: Use minimal-length literals to initialize PI and E constants
Stuart Marks
smarks at openjdk.java.net
Tue Mar 15 02:44:46 UTC 2022
On Tue, 15 Mar 2022 01:36:14 GMT, Joe Darcy <darcy at openjdk.org> wrote:
> Depending on the range of the number line, a double value has between 15 and 17 digits of decimal precision. The literals used to initialize Math.PI and Math.E have several digits more precision than that maximum.
>
> That is potentially confusing to readers of the code and the minimum length strings to exactly represent the value in question should be used instead.
I've verified that the shorter literals result in the same double bit pattern.
-------------
Marked as reviewed by smarks (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/7814
More information about the core-libs-dev
mailing list