Debian Codegraph @

js/src/tests/test262/built-ins/Math/sumPrecise/sum-is-NaN.js

raw
1 // |reftest| shell-option(--enable-math-sumprecise) skip-if(!Math.sumPrecise||!xulRuntime.shell) -- Math.sumPrecise is not enabled unconditionally, requires shell-options
2 // Copyright (C) 2024 Kevin Gibbons. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 esid: sec-math.sumprecise
7 description: Math.sumPrecise returns NaN when input has NaN or when adding infinities
8 features: [Math.sumPrecise]
9 ---*/
10
11 assert.sameValue(Math.sumPrecise([NaN]), NaN);
12 assert.sameValue(Math.sumPrecise([Infinity, -Infinity]), NaN);
13 assert.sameValue(Math.sumPrecise([-Infinity, Infinity]), NaN);
14
15 reportCompare(0, 0);