Intent to ship: Math.sumPrecise

129 views
Skip to first unread message

Daniel Minor

unread,
Feb 5, 2025, 12:24:39 PMFeb 5
to dev-pl...@mozilla.org
As of Firefox 137, I intend to enable Math.sumPrecise by default on all platforms. It is currently enabled only in Nightly builds, behind the `javascript.options.experimental.math_sumprecise` preference. Math.sumPrecise minimizes the rounding error when summing a sequence of floating point numbers, that is, it provides a better result than naively adding x1 + x2 + x3 + x4 + ... one by one. Our implementation makes use of Radford Neal's xsum library, and was contributed by a volunteer, Debadree Chatterjee. Thanks Debadree :)

It reached Stage 3 of the TC39 process in October 2024. JavaScriptCore shipped their implementation in Tech Preview 205: https://developer.apple.com/documentation/safari-technology-preview-release-notes/stp-release-205. Work has not yet started in V8: https://issues.chromium.org/issues/374310075.
Reply all
Reply to author
Forward
0 new messages