Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/subtraction/S11.6.2_A4_T2.js

raw
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: Operator x - y produces the same result as x + (-y)
6 es5id: 11.6.2_A4_T2
7 description: >
8 The difference of two infinities of opposite sign is the infinity
9 of minuend sign
10 ---*/
11
12 //CHECK#1
13 if (Number.POSITIVE_INFINITY - Number.NEGATIVE_INFINITY !== Number.POSITIVE_INFINITY ) {
14 $ERROR('#1: Infinity - -Infinity === Infinity. Actual: ' + (Infinity - -Infinity));
15 }
16
17 //CHECK#2
18 if (Number.NEGATIVE_INFINITY - Number.POSITIVE_INFINITY !== Number.NEGATIVE_INFINITY ) {
19 $ERROR('#2: -Infinity - Infinity === -Infinity. Actual: ' + (-Infinity - Infinity));
20 }