js/src/jit-test/tests/jaeger/inline/mathSqrt.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.

     2 assertEq(Math.sqrt(-Infinity), NaN);
     3 assertEq(Math.sqrt(-3.14), NaN);
     4 assertEq(Math.sqrt(-2), NaN);
     5 assertEq(Math.sqrt(-0), -0);
     6 assertEq(Math.sqrt(0), 0);
     7 assertEq(Math.sqrt(2), Math.SQRT2);
     8 assertEq(Math.sqrt(49), 7);
     9 assertEq(Math.sqrt(Infinity), Infinity);
    11 /* Inferred as sqrt(double). */
    12 function sqrt1(x) {
    13     return Math.sqrt(x);
    14 }
    15 assertEq(sqrt1(NaN), NaN);
    16 assertEq(sqrt1(-Infinity), NaN);
    17 assertEq(sqrt1(Infinity), Infinity);
    18 assertEq(sqrt1(-0), -0);
    19 assertEq(sqrt1(2), Math.SQRT2);
    20 assertEq(sqrt1(16), 4);
    22 /* Inferred as sqrt(int). */
    23 function sqrt2(x) {
    24     return Math.sqrt(x);
    25 }
    26 assertEq(sqrt2(4), 2);
    27 assertEq(sqrt2(169), 13);
    28 assertEq(sqrt2(0), 0);

mercurial