Skip to content
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

8261366: Add discussion of IEEE 754 to BigDecimal #2868

Closed
wants to merge 3 commits into from

Conversation

jddarcy
Copy link
Member

@jddarcy jddarcy commented Mar 8, 2021

Informative update to BigDecimal and related classes to latest IEEE 754 terminology, including a discussion of the similarities and differences of BigDecimal and IEEE 754 decimal arithmetic.

Once the wording is finalized, I'll reflow any modified paragraphs and update the copyright years, etc.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8261366: Add discussion of IEEE 754 to BigDecimal

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/2868/head:pull/2868
$ git checkout pull/2868

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 8, 2021

👋 Welcome back darcy! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@jddarcy jddarcy changed the title 8261366: Add discussion of IEEE 754 to BigDecima 8261366: Add discussion of IEEE 754 to BigDecimal Mar 8, 2021
@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 8, 2021
@openjdk
Copy link

openjdk bot commented Mar 8, 2021

@jddarcy The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the core-libs core-libs-dev@openjdk.org label Mar 8, 2021
@mlbridge
Copy link

mlbridge bot commented Mar 8, 2021

Webrevs

* representable values. Most operations accept as input one or more
* values of a given format and produce a result in the same format.
* A {@code BigDecimal}'s {@linkplain scale() scale} is equivalent to
* negating an IEEE 754 value's exponent. {@code BigDecimal} values to
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to -> do

* by the precision of the {@code MathContext} argument. For example
* in {@code BigDecimal}, if a nonzero three-digit number and a
* nonzero four-digit number are multiplied together in the context of
* a {@code MathContext} object has a precision of three, the result
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

has -> having

* used to round all starting values and intermediate operations. The
* numerical values computed can differ if the exponent range of the
* IEEE 754 format being approximated is exceeded since a {@code
* MathContext} does not curtail the scale {@code BigDecimal}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the scale -> the scale of

Suggest using another word than curtail, whose meaning will not be immediately clear to non-native readers as it's not a technical term.

* IEEE 754 format being approximated is exceeded since a {@code
* MathContext} does not curtail the scale {@code BigDecimal}
* results. Operations that would generate a NaN or exact infinity,
* such as dividing by zero, throw an {@code Arithmetic-Exception} in
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arithmetic-Exception -> ArithmeticException

@mlbridge
Copy link

mlbridge bot commented Mar 8, 2021

Mailing list message from Joe Darcy on core-libs-dev:

Thanks for the review Florent; will fix in the next push,

-Joe

On 3/8/2021 1:57 AM, Florent Guillaume wrote:

Copy link
Member

@bplb bplb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine.

@openjdk
Copy link

openjdk bot commented Mar 8, 2021

@jddarcy This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8261366: Add discussion of IEEE 754 to BigDecimal

Reviewed-by: bpb

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 18 new commits pushed to the master branch:

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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 8, 2021
@jddarcy
Copy link
Member Author

jddarcy commented Mar 8, 2021

/integrate

@openjdk openjdk bot closed this Mar 8, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 8, 2021
@openjdk
Copy link

openjdk bot commented Mar 8, 2021

@jddarcy Since your change was applied there have been 18 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

Pushed as commit 14cfbda.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@jddarcy jddarcy deleted the 8261366 branch June 10, 2021 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants