Kevin Gibbons 3d5c52e112
add tests for Math.sumPrecise (#4049)
* add tests for Math.sumPrecise

* add feature

* I hate yaml

* fix writability check
2024-07-03 08:56:34 -07:00

13 lines
456 B
JavaScript

// Copyright (C) 2024 Kevin Gibbons. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-math.sumprecise
description: Math.sumPrecise returns NaN when input has NaN or when adding infinities
features: [Math.sumPrecise]
---*/
assert.sameValue(Math.sumPrecise([NaN]), NaN);
assert.sameValue(Math.sumPrecise([Infinity, -Infinity]), NaN);
assert.sameValue(Math.sumPrecise([-Infinity, Infinity]), NaN);