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