sum-is-NaN.js (567B)
1 // |reftest| skip-if(!Math.sumPrecise) -- Math.sumPrecise is not enabled unconditionally 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);