-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Normative: add Math.sumPrecise #3654
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
Open
bakkot
wants to merge
1
commit into
main
Choose a base branch
from
sum-precise
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 tasks
1. If _state_ is ~minus-infinity~, return *-∞*<sub>𝔽</sub>. | ||
1. If _state_ is ~minus-zero~, return *-0*<sub>𝔽</sub>. | ||
1. Return 𝔽(_sum_). | ||
1. NOTE: The value of _sum_ can be computed without arbitrary-precision arithmetic by a variety of algorithms. One such is the "Grow-Expansion" algorithm given in <i>Adaptive Precision Floating-Point Arithmetic and Fast Robust Geometric Predicates</i> by Jonathan Richard Shewchuk. A more recent algorithm is given in "<a href="https://arxiv.org/abs/1505.05571">Fast exact summation using small and large superaccumulators</a>", code for which is available at <a href="https://gitlab.com/radfordneal/xsum">https://gitlab.com/radfordneal/xsum</a>. |
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.
This should be an <emu-note>
, not a note step.
Comment on lines
+33231
to
+33234
1. If _count_ ≥ 2<sup>53</sup>, then | ||
1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). | ||
1. Return ? IteratorClose(_iteratorRecord_, _error_). | ||
1. NOTE: The above case is not expected to be reached in practice and is included only so that implementations may rely on inputs being "reasonably sized" without violating this specification. |
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.
Suggested change
1. If _count_ ≥ 2<sup>53</sup>, then | |
1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). | |
1. Return ? IteratorClose(_iteratorRecord_, _error_). | |
1. NOTE: The above case is not expected to be reached in practice and is included only so that implementations may rely on inputs being "reasonably sized" without violating this specification. | |
1. If _count_ ≥ 2<sup>53</sup>, then | |
1. NOTE: This step is not expected to be reached in practice and is included only so that implementations may rely on inputs being "reasonably sized" without violating this specification. | |
1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). | |
1. Return ? IteratorClose(_iteratorRecord_, _error_). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
has test262 tests
normative change
Affects behavior required to correctly evaluate some ECMAScript source text
pending stage 4
This proposal has not yet achieved stage 4, but may otherwise be ready to merge.
proposal
This is related to a specific proposal, and will be closed/merged when the proposal reaches stage 4.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pending stage 4.