sum-is-minus-zero.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 -0 on an empty list or list of all -0 8 features: [Math.sumPrecise] 9 ---*/ 10 11 assert.sameValue(Math.sumPrecise([]), -0); 12 assert.sameValue(Math.sumPrecise([-0]), -0); 13 assert.sameValue(Math.sumPrecise([-0, -0]), -0); 14 assert.sameValue(Math.sumPrecise([-0, 0]), 0); 15 16 reportCompare(0, 0);