From d4775119ff253201967f8486f26a153ce404c435 Mon Sep 17 00:00:00 2001
From: Vansh Dobariya <167301367+VanshBD@users.noreply.github.com>
Date: Mon, 15 Jun 2026 16:49:24 +0530
Subject: [PATCH 1/2] lib: add Math.sumPrecise type definition (ES2026 /
esnext)
---
src/compiler/commandLineParser.ts | 1 +
src/lib/esnext.d.ts | 1 +
src/lib/esnext.math.d.ts | 12 ++++++++++++
src/lib/libs.json | 1 +
4 files changed, 15 insertions(+)
create mode 100644 src/lib/esnext.math.d.ts
diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts
index c17cc4ef9ca01..a162ea3318a69 100644
--- a/src/compiler/commandLineParser.ts
+++ b/src/compiler/commandLineParser.ts
@@ -256,6 +256,7 @@ const libEntries: [string, string][] = [
["esnext.disposable", "lib.esnext.disposable.d.ts"],
["esnext.error", "lib.esnext.error.d.ts"],
["esnext.intl", "lib.esnext.intl.d.ts"],
+ ["esnext.math", "lib.esnext.math.d.ts"],
["esnext.sharedmemory", "lib.esnext.sharedmemory.d.ts"],
["esnext.temporal", "lib.esnext.temporal.d.ts"],
["esnext.typedarrays", "lib.esnext.typedarrays.d.ts"],
diff --git a/src/lib/esnext.d.ts b/src/lib/esnext.d.ts
index 10d459816a349..acbb46fd351eb 100644
--- a/src/lib/esnext.d.ts
+++ b/src/lib/esnext.d.ts
@@ -9,3 +9,4 @@
///
///
///
+///
diff --git a/src/lib/esnext.math.d.ts b/src/lib/esnext.math.d.ts
new file mode 100644
index 0000000000000..c8d05f10c7991
--- /dev/null
+++ b/src/lib/esnext.math.d.ts
@@ -0,0 +1,12 @@
+interface Math {
+ /**
+ * Returns the sum of the values in the iterable using a more precise
+ * summation algorithm than naive floating-point addition.
+ * Returns `-0` if the iterable is empty.
+ * @param numbers An iterable (such as an Array) of numbers.
+ * @throws {TypeError} If `numbers` is not iterable, or if any value
+ * in the iterable is not of type `number`.
+ * @throws {RangeError} If the iterable yields 2^53 or more values.
+ */
+ sumPrecise(numbers: Iterable): number;
+}
diff --git a/src/lib/libs.json b/src/lib/libs.json
index 5bc6a8b57a2c1..2d5e6e2b1abda 100644
--- a/src/lib/libs.json
+++ b/src/lib/libs.json
@@ -92,6 +92,7 @@
"esnext.decorators",
"esnext.disposable",
"esnext.error",
+ "esnext.math",
"esnext.intl",
"esnext.sharedmemory",
"esnext.temporal",
From bbff73934a7454ea6f1ab9fb49c8d926a1a2bdb5 Mon Sep 17 00:00:00 2001
From: Vansh Dobariya <167301367+VanshBD@users.noreply.github.com>
Date: Mon, 15 Jun 2026 17:09:55 +0530
Subject: [PATCH 2/2] lib: fix alphabetical order in libs.json
---
src/lib/libs.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/libs.json b/src/lib/libs.json
index 2d5e6e2b1abda..f3128a699aa27 100644
--- a/src/lib/libs.json
+++ b/src/lib/libs.json
@@ -92,8 +92,8 @@
"esnext.decorators",
"esnext.disposable",
"esnext.error",
- "esnext.math",
"esnext.intl",
+ "esnext.math",
"esnext.sharedmemory",
"esnext.temporal",
"esnext.typedarrays",