From a11ef4f87c045d5afe610f39e6647eaa48358314 Mon Sep 17 00:00:00 2001 From: fenley <49503866+godfengliang@users.noreply.github.com> Date: Mon, 1 Jun 2026 19:51:14 +0800 Subject: [PATCH 1/2] Add Math.sumPrecise type definition (ES2026) --- src/lib/esnext.math.d.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/lib/esnext.math.d.ts diff --git a/src/lib/esnext.math.d.ts b/src/lib/esnext.math.d.ts new file mode 100644 index 0000000000000..7de13642e009e --- /dev/null +++ b/src/lib/esnext.math.d.ts @@ -0,0 +1,15 @@ +/** TypeScript Definition File + * Created: ES2026 + */ + +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; +} From 59e9a0f1af2efe2c96fbed6118ea56d1d40a5098 Mon Sep 17 00:00:00 2001 From: fenley <49503866+godfengliang@users.noreply.github.com> Date: Mon, 1 Jun 2026 19:51:54 +0800 Subject: [PATCH 2/2] Add reference to esnext.math in esnext.d.ts --- src/lib/esnext.d.ts | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/lib/esnext.d.ts b/src/lib/esnext.d.ts index 10d459816a349..a0d74d676f7ad 100644 --- a/src/lib/esnext.d.ts +++ b/src/lib/esnext.d.ts @@ -1,11 +1,12 @@ -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// \ No newline at end of file