js/src/tests/ecma_6/Math/log2-approx.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/log2-approx.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,8 @@
     1.4 +for (var i = -10; i < 10; i++)
     1.5 +    assertNear(Math.log2(Math.pow(2, i)), i);
     1.6 +
     1.7 +assertNear(Math.log2(5), 2.321928094887362);
     1.8 +assertNear(Math.log2(7), 2.807354922057604);
     1.9 +assertNear(Math.log2(Math.E), Math.LOG2E);
    1.10 +
    1.11 +reportCompare(0, 0, "ok");

mercurial