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..f3128a699aa27 100644 --- a/src/lib/libs.json +++ b/src/lib/libs.json @@ -93,6 +93,7 @@ "esnext.disposable", "esnext.error", "esnext.intl", + "esnext.math", "esnext.sharedmemory", "esnext.temporal", "esnext.typedarrays",