js/src/tests/ecma_6/Math/log10-exact.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/ecma_6/Math/log10-exact.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,30 @@
     1.4 +// Properties of Math.log10 that are guaranteed by the spec.
     1.5 +
     1.6 +// If x is NaN, the result is NaN.
     1.7 +assertEq(Math.log10(NaN), NaN);
     1.8 +
     1.9 +// If x is less than 0, the result is NaN.
    1.10 +assertEq(Math.log10(-1e-10), NaN);
    1.11 +assertEq(Math.log10(-1e-5), NaN);
    1.12 +assertEq(Math.log10(-1e-1), NaN);
    1.13 +assertEq(Math.log10(-Number.MIN_VALUE), NaN);
    1.14 +assertEq(Math.log10(-Number.MAX_VALUE), NaN);
    1.15 +assertEq(Math.log10(-Infinity), NaN);
    1.16 +
    1.17 +for (var i = -1; i > -10; i--)
    1.18 +    assertEq(Math.log10(i), NaN);
    1.19 +
    1.20 +// If x is +0, the result is −∞.
    1.21 +assertEq(Math.log10(+0), -Infinity);
    1.22 +
    1.23 +// If x is −0, the result is −∞.
    1.24 +assertEq(Math.log10(-0), -Infinity);
    1.25 +
    1.26 +// If x is 1, the result is +0.
    1.27 +assertEq(Math.log10(1), +0);
    1.28 +
    1.29 +// If x is +∞, the result is +∞.
    1.30 +assertEq(Math.log10(Infinity), Infinity);
    1.31 +
    1.32 +
    1.33 +reportCompare(0, 0, 'ok');

mercurial