← Chrome 147 reference

v147 · javascript · covered on mdn

Math.sumPrecise

Baseline 2026 · Newly available

  • Chrome · 147
  • Edge · 147
  • Firefox · 137
  • Safari · 26.2

The Math.sumPrecise() web-feature is Baseline Newly available since 2026-04-10 on webstatus.dev (baseline.status: "newly", low_date: 2026-04-10; queried 2026-11-22). Firefox 137 (2025-04-01) and Safari 26.2 (2025-12-12) shipped first; Chrome 147 (2026-04-07) and Edge 147 (2026-04-10) completed the set. Not yet Widely available — feature-detect and keep a fallback (see Examples).

A static method that sums an iterable of numbers and returns the exact mathematical sum rounded once to the nearest double, avoiding the floating-point precision loss that accumulates when adding values in a naive loop. TC39 Stage 4 (ECMAScript 2026).

this feature is documented on MDN

MDN: Math.sumPrecise()

MDN has a full reference page including the algorithm details, examples comparing results to a naive loop sum, browser compatibility, and the TC39 proposal link. gendn doesn't duplicate that here.

quick reference

SignatureMath.sumPrecise(iterable)
Returnsnumber — the precisely computed sum
Typical useFinancial totals, physics simulations, statistical aggregates where error accumulation matters
Shipped inChrome 147 (desktop + Android)
StandardECMAScript 2026 (TC39 Stage 4)
ChromeStatus4790090146643968 — Math.sumPrecise
TC39 proposaltc39 / proposal-math-sum
Source: MDN and chromestatus, May 2026; proposal link per the ChromeStatus API record’s spec field (2026-11-22).

Syntax

Signature from ECMA-262 §21.3.2.34 Math.sumPrecise ( items ) (fetched 2026-11-22):

Math.sumPrecise(items)

Parameters

Return value

Exceptions

Source: ECMA-262 §Math.sumPrecise (algorithm steps, fetched 2026-11-22); tc39/proposal-math-sum.

Examples

Live example from the Chrome Platform Showcase (float-drift-lab concept, HTTP 200 verified 2026-11-22): naive loop summation side by side with Math.sumPrecise.Source: chrome-platform-showcase — math-sumprecise

Naive sum vs. precise sum

const values = [1e20, 0.1, -1e20];

values.reduce((a, b) => a + b, 0); // 0   — the 0.1 is lost
Math.sumPrecise(values);            // 0.1

// exact sum of the two doubles, rounded once:
Math.sumPrecise([0.1, 0.2]);        // 0.30000000000000004
Math.sumPrecise([]);                // -0

Feature detection with a fallback

const sum = typeof Math.sumPrecise === "function"
  ? (xs) => Math.sumPrecise(xs)
  : (xs) => { let s = 0; for (const x of xs) s += x; return s; }; // less precise fallback

try {
  Math.sumPrecise([1, "2"]);
} catch (e) {
  console.log(e instanceof TypeError); // true — no coercion of "2"
}
Source: ECMA-262 §Math.sumPrecise; live float-drift-lab demo.

Browser compatibility

Per-version support — BCD javascript/builtins/Math.json key sumPrecise (raw, fetched 2026-11-22)
BrowserVersionNotes
Chrome147Standard track, not experimental, not deprecated
Chrome Android147BCD mirror of Chrome
Edge147BCD mirror of Chrome
Firefox137Firefox for Android: mirror (137)
Safari26.2Safari on iOS: mirror (26.2)
Source: BCD javascript/builtins/Math.json; webstatus.dev — Math.sumPrecise() (Baseline Newly available, 2026-04-10).

Specifications

See also