michael@0: // Properties of Math.log2 that are guaranteed by the spec. michael@0: michael@0: // If x is NaN, the result is NaN. michael@0: assertEq(Math.log2(NaN), NaN); michael@0: michael@0: // If x is less than 0, the result is NaN. michael@0: assertEq(Math.log2(-1e-10), NaN); michael@0: assertEq(Math.log2(-1e-5), NaN); michael@0: assertEq(Math.log2(-1e-1), NaN); michael@0: assertEq(Math.log2(-Number.MIN_VALUE), NaN); michael@0: assertEq(Math.log2(-Number.MAX_VALUE), NaN); michael@0: assertEq(Math.log2(-Infinity), NaN); michael@0: michael@0: for (var i = -1; i > -10; i--) michael@0: assertEq(Math.log2(i), NaN); michael@0: michael@0: // If x is +0, the result is −∞. michael@0: assertEq(Math.log2(+0), -Infinity); michael@0: michael@0: // If x is −0, the result is −∞. michael@0: assertEq(Math.log2(-0), -Infinity); michael@0: michael@0: // If x is 1, the result is +0. michael@0: assertEq(Math.log2(1), +0); michael@0: michael@0: // If x is +∞, the result is +∞. michael@0: assertEq(Math.log2(Infinity), Infinity); michael@0: michael@0: michael@0: reportCompare(0, 0, 'ok');