aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite/sputnik_converted/11_Expressions/11.6_Additive_Operators/11.6.1_The_Addition_operator/S11.6.1_A4_T2.js
blob: 55c7751f48d66fd60554d84a534b64f012473712 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
* @name: S11.6.1_A4_T2;
* @section: 11.6.1, 11.6.3;
* @assertion: The result of an addition is determined using the rules of IEEE 754 double-precision arithmetics; 
* @description: The sum of two infinities of opposite sign is NaN;
*/


// Converted for Test262 from original Sputnik source

ES5Harness.registerTest( {
id: "S11.6.1_A4_T2",

path: "TestCases/11_Expressions/11.6_Additive_Operators/11.6.1_The_Addition_operator/S11.6.1_A4_T2.js",

assertion: "The result of an addition is determined using the rules of IEEE 754 double-precision arithmetics",

description: "The sum of two infinities of opposite sign is NaN",

test: function testcase() {
   //CHECK#1
if (isNaN(Number.POSITIVE_INFINITY + Number.NEGATIVE_INFINITY) !== true ) {
  $ERROR('#1: Infinity + -Infinity === Not-a-Number. Actual: ' + (Infinity + -Infinity));
}

//CHECK#2
if (isNaN(Number.NEGATIVE_INFINITY + Number.POSITIVE_INFINITY) !== true ) {
  $ERROR('#2: -Infinity + Infinity === Not-a-Number. Actual: ' + (-Infinity + Infinity));
}




 }
});