Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /**
5 * The result of a floating-point multiplication is governed by the rules of IEEE 754 double-precision arithmetics
6 *
7 * @path ch11/11.5/11.5.1/S11.5.1_A4_T3.js
8 * @description Multiplication of an infinity by a zero results in NaN
9 */
11 //CHECK#1
12 if (isNaN(Number.NEGATIVE_INFINITY * 0) !== true) {
13 $ERROR('#1: Infinity * 0 === Not-a-Number. Actual: ' + (Infinity * 0));
14 }
16 //CHECK#2
17 if (isNaN(-0 * Number.NEGATIVE_INFINITY) !== true) {
18 $ERROR('#2: -0 * -Infinity === Not-a-Number. Actual: ' + (-0 * -Infinity));
19 }
21 //CHECK#3
22 if (isNaN(Number.POSITIVE_INFINITY * -0) !== true) {
23 $ERROR('#3: Infinity * -0 === Not-a-Number. Actual: ' + (Infinity * -0));
24 }
26 //CHECK#4
27 if (isNaN(0 * Number.POSITIVE_INFINITY) !== true) {
28 $ERROR('#4: 0 * Infinity === Not-a-Number. Actual: ' + (0 * Infinity));
29 }
31 //CHECK#5
32 if (isNaN(Number.NEGATIVE_INFINITY * -0) !== true) {
33 $ERROR('#5: Infinity * -0 === Not-a-Number. Actual: ' + (Infinity * -0));
34 }
36 //CHECK#6
37 if (isNaN(0 * Number.NEGATIVE_INFINITY) !== true) {
38 $ERROR('#6: 0 * -Infinity === Not-a-Number. Actual: ' + (0 * -Infinity));
39 }
41 //CHECK#7
42 if (isNaN(Number.POSITIVE_INFINITY * 0) !== true) {
43 $ERROR('#7: Infinity * 0 === Not-a-Number. Actual: ' + (Infinity * 0));
44 }
46 //CHECK#8
47 if (isNaN(-0 * Number.POSITIVE_INFINITY) !== true) {
48 $ERROR('#8: -0 * Infinity === Not-a-Number. Actual: ' + (-0 * Infinity));
49 }