Bug report
π Description
Math.sumPrecise is part of the TC39 proposal-math-sum which reached Stage 4 on 2025-07-28, making it part of ES2026 (not ES2025 as originally stated β the proposal missed the ES2025 cutoff by about one month). Major runtimes like Bun, Firefox 137+, and Safari 18.4 have already implemented it, though V8/Node.js has not yet.
However, TypeScript does not include type definitions for this API β searching through all lib.es*.d.ts files yields no results for sumPrecise.
π The problem
This causes a compile error:
Property 'sumPrecise' does not exist on type 'Math'. ts(2339)
Users are forced to either:
- Use workarounds like type augmentation (
global.d.ts)
- Fall back to
@ts-expect-error
- Use incorrect alternatives like
Array.reduce((a, b) => a + b) which lose precision
β
Expected behavior
The interface Math should be extended in lib.esnext.math.d.ts:
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>): number;
}
π Related
Bug report
π Description
Math.sumPreciseis part of the TC39proposal-math-sumwhich reached Stage 4 on 2025-07-28, making it part of ES2026 (not ES2025 as originally stated β the proposal missed the ES2025 cutoff by about one month). Major runtimes like Bun, Firefox 137+, and Safari 18.4 have already implemented it, though V8/Node.js has not yet.However, TypeScript does not include type definitions for this API β searching through all
lib.es*.d.tsfiles yields no results forsumPrecise.π The problem
This causes a compile error:
Users are forced to either:
global.d.ts)@ts-expect-errorArray.reduce((a, b) => a + b)which lose precisionβ Expected behavior
The
interface Mathshould be extended inlib.esnext.math.d.ts:π Related