diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b13cb92f793..86d20a7ef5f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ - Added `es.` namespace modules, `/es/` and `/stable/` namespaces entries - [Explicit Resource Management stage 3 proposal](https://github.com/tc39/proposal-explicit-resource-management) - Some minor updates like [explicit-resource-management/217](https://github.com/tc39/proposal-explicit-resource-management/pull/217) +- Added [`Math.sumPrecise`](https://github.com/tc39/proposal-math-sum/) stage 2.7 proposal + - Built-ins: + - `Math.sumPrecise` - [`Promise.try`](https://github.com/tc39/proposal-promise-try): - Built-ins: - `Promise.try` diff --git a/README.md b/README.md index abcdfedb2305..8f047dcf86e2 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,7 @@ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3]) - [`Symbol.metadata` for decorators metadata proposal](#symbolmetadata-for-decorators-metadata-proposal) - [Stage 2.7 proposals](#stage-27-proposals) - [`Promise.try`](#promisetry) + - [`Math.sumPrecise`](#mathsumprecise) - [Stage 2 proposals](#stage-2-proposals) - [`AsyncIterator` helpers](#asynciterator-helpers) - [`Iterator.range`](#iteratorrange) @@ -2525,6 +2526,24 @@ Promise.try(async () => 42).then(it => console.log(`Promise, resolved as ${it}`) Promise.try(async () => { throw 42; }).catch(it => console.log(`Promise, rejected as ${it}`)); ``` +##### [`Math.sumPrecise`](https://github.com/tc39/proposal-math-sum) +Module [`esnext.math.sum-precise`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.math.sum-precise.js) +```js +class Math { + static sumPrecise(items: Iterable): Number; +} +``` +[*CommonJS entry points:*](#commonjs-api) +```js +core-js/proposals/math-sum +core-js(-pure)/full/math/sum-precise +``` +[*Examples*](https://tinyurl.com/2bd3nako): +```js +1e20 + 0.1 + -1e20; // => 0 +Math.sumPrecise([1e20, 0.1, -1e20]); // => 0.1 +``` + #### Stage 2 proposals[⬆](#index) [*CommonJS entry points:*](#commonjs-api) ```