js/src/jit-test/tests/jaeger/inline/mathPow.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1
michael@0 2 assertEq(Math.pow(100, 2), 10000);
michael@0 3 assertEq(Math.pow(-Infinity, -0.5), 0);
michael@0 4 assertEq(Math.pow(-Infinity, 0.5), Infinity);
michael@0 5 assertEq(Math.pow(Infinity, -0.5), 0);
michael@0 6 assertEq(Math.pow(Infinity, 0.5), Infinity);
michael@0 7 assertEq(Math.pow(NaN, -0.5), NaN);
michael@0 8 assertEq(Math.pow(NaN, 0.5), NaN);
michael@0 9 assertEq(Math.pow(-3.14, -0.5), NaN);
michael@0 10 assertEq(Math.pow(-1.23, 0.5), NaN);
michael@0 11 assertEq(Math.pow(-0, -0.5), Infinity);
michael@0 12 assertEq(Math.pow(-0, 0.5), 0);
michael@0 13 assertEq(Math.pow(-1, -0.5), NaN);
michael@0 14 assertEq(Math.pow(-1, 0.5), NaN);
michael@0 15 assertEq(Math.pow(0, -0.5), Infinity);
michael@0 16 assertEq(Math.pow(0, 0.5), 0);
michael@0 17 assertEq(Math.pow(1, -0.5), 1);
michael@0 18 assertEq(Math.pow(1, 0.5), 1);
michael@0 19 assertEq(Math.pow(100, -0.5), 0.1);
michael@0 20 assertEq(Math.pow(100, 0.5), 10);
michael@0 21
michael@0 22 /* Inferred as pow(double, double). */
michael@0 23 function pow1(x) {
michael@0 24 return Math.pow(x, 0.5);
michael@0 25 }
michael@0 26 assertEq(pow1(100), 10);
michael@0 27 assertEq(pow1(144), 12);
michael@0 28 assertEq(pow1(-0), 0);
michael@0 29 assertEq(pow1(0), 0);
michael@0 30 assertEq(pow1(1), 1);
michael@0 31 assertEq(pow1(-1), NaN);
michael@0 32 assertEq(pow1(NaN), NaN);
michael@0 33 assertEq(pow1(-Infinity), Infinity);
michael@0 34 assertEq(pow1(Infinity), Infinity);
michael@0 35

mercurial