Debian Codegraph @

js/src/tests/test262/built-ins/Math/sumPrecise/sum-is-minus-zero.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 -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);