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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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