js/src/tests/ecma_6/Math/acosh-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/acosh-exact.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,26 @@
     1.4 +// Properties of Math.acosh that are guaranteed by the spec.
     1.5 +
     1.6 +// If x is NaN, the result is NaN.
     1.7 +assertEq(Math.acosh(NaN), NaN);
     1.8 +
     1.9 +// If x is less than 1, the result is NaN.
    1.10 +assertEq(Math.acosh(ONE_MINUS_EPSILON), NaN);
    1.11 +assertEq(Math.acosh(Number.MIN_VALUE), NaN);
    1.12 +assertEq(Math.acosh(+0), NaN);
    1.13 +assertEq(Math.acosh(-0), NaN);
    1.14 +assertEq(Math.acosh(-Number.MIN_VALUE), NaN);
    1.15 +assertEq(Math.acosh(-1), NaN);
    1.16 +assertEq(Math.acosh(-Number.MAX_VALUE), NaN);
    1.17 +assertEq(Math.acosh(-Infinity), NaN);
    1.18 +
    1.19 +for (var i = -20; i < 1; i++)
    1.20 +    assertEq(Math.acosh(i), NaN);
    1.21 +
    1.22 +// If x is 1, the result is +0.
    1.23 +assertEq(Math.acosh(1), +0);
    1.24 +
    1.25 +// If x is +∞, the result is +∞.
    1.26 +assertEq(Math.acosh(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY);
    1.27 +
    1.28 +
    1.29 +reportCompare(0, 0, "ok");

mercurial