New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JDK-8283143: Use minimal-length literals to initialize PI and E constants #7814
Conversation
|
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've verified that the shorter literals result in the same double bit pattern.
@jddarcy This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 21 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.
|
Mailing list message from Raffaello Giulietti on core-libs-dev: The new decimal literals have indeed the minimal length required to Raffaello On 3/15/22 02:43, Joe Darcy wrote: |
/integrate |
Going to push as commit 671b6ef.
Your commit was automatically rebased without conflicts. |
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.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/7814/head:pull/7814
$ git checkout pull/7814
Update a local copy of the PR:
$ git checkout pull/7814
$ git pull https://git.openjdk.java.net/jdk pull/7814/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 7814
View PR using the GUI difftool:
$ git pr show -t 7814
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/7814.diff