| 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: | |
| 6 |
The result of an addition is determined using the rules of IEEE 754 |
| 7 |
double-precision arithmetics |
| 8 |
es5id: 11.6.1_A4_T2 |
| 9 |
description: The sum of two infinities of opposite sign is NaN |
| 10 |
---*/ |
| 11 |
|
| 12 |
//CHECK#1 |
| 13 |
if (isNaN(Number.POSITIVE_INFINITY + Number.NEGATIVE_INFINITY) !== true ) { |
| 14 |
$ERROR('#1: Infinity + -Infinity === Not-a-Number. Actual: ' + (Infinity + -Infinity)); |
| 15 |
} |
| 16 |
|
| 17 |
//CHECK#2 |
| 18 |
if (isNaN(Number.NEGATIVE_INFINITY + Number.POSITIVE_INFINITY) !== true ) { |
| 19 |
$ERROR('#2: -Infinity + Infinity === Not-a-Number. Actual: ' + (-Infinity + Infinity)); |
| 20 |
} |