michael@0: // Copyright 2009 the Sputnik authors. All rights reserved. michael@0: // This code is governed by the BSD license found in the LICENSE file. michael@0: michael@0: /** michael@0: * The result of a floating-point multiplication is governed by the rules of IEEE 754 double-precision arithmetics michael@0: * michael@0: * @path ch11/11.5/11.5.1/S11.5.1_A4_T1.2.js michael@0: * @description If right operand is NaN, the result is NaN michael@0: */ michael@0: michael@0: //CHECK#1 michael@0: if (isNaN(Number.NaN * Number.NaN) !== true) { michael@0: $ERROR('#1: NaN * NaN === Not-a-Number. Actual: ' + (NaN * NaN)); michael@0: } michael@0: michael@0: //CHECK#2 michael@0: if (isNaN(+0 * Number.NaN) !== true) { michael@0: $ERROR('#2: +0 * NaN === Not-a-Number. Actual: ' + (+0 * NaN)); michael@0: } michael@0: michael@0: //CHECK#3 michael@0: if (isNaN(-0 * Number.NaN) !== true) { michael@0: $ERROR('#3: -0 * NaN === Not-a-Number. Actual: ' + (-0 * NaN)); michael@0: } michael@0: michael@0: //CHECK#4 michael@0: if (isNaN(Number.POSITIVE_INFINITY * Number.NaN) !== true) { michael@0: $ERROR('#4: Infinity * NaN === Not-a-Number. Actual: ' + (Infinity * NaN)); michael@0: } michael@0: michael@0: //CHECK#5 michael@0: if (isNaN(Number.NEGATIVE_INFINITY * Number.NaN) !== true) { michael@0: $ERROR('#5: -Infinity * NaN === Not-a-Number. Actual: ' + ( -Infinity * NaN)); michael@0: } michael@0: michael@0: //CHECK#6 michael@0: if (isNaN(Number.MAX_VALUE * Number.NaN) !== true) { michael@0: $ERROR('#6: Number.MAX_VALUE * NaN === Not-a-Number. Actual: ' + (Number.MAX_VALUE * NaN)); michael@0: } michael@0: michael@0: //CHECK#7 michael@0: if (isNaN(Number.MIN_VALUE * Number.NaN) !== true) { michael@0: $ERROR('#7: Number.MIN_VALUE * NaN === Not-a-Number. Actual: ' + (Number.MIN_VALUE * NaN)); michael@0: } michael@0: michael@0: //CHECK#8 michael@0: if (isNaN(1 * Number.NaN) !== true) { michael@0: $ERROR('#8: 1 * NaN === Not-a-Number. Actual: ' + (1 * NaN)); michael@0: } michael@0: