added Math.sumPrecise()

This commit is contained in:
Fabrice Bellard
2025-09-27 18:44:19 +02:00
parent 456e016f7c
commit bc753c6a15
4 changed files with 260 additions and 2 deletions

View File

@@ -357,6 +357,7 @@ function test_math()
assert(Math.hypot(-2), 2);
assert(Math.hypot(3, 4), 5);
assert(Math.abs(Math.hypot(3, 4, 5) - 7.0710678118654755) <= 1e-15);
assert(Math.sumPrecise([1,Number.EPSILON/2,Number.MIN_VALUE]), 1.0000000000000002);
}
function test_number()