]>
Commit | Line | Data |
---|---|---|
ed1e77d3 A |
1 | function exponentIsNonNanDouble1(x, doubleArrayIndex) { |
2 | var doubleArray = [4.4]; | |
3 | return Math.pow(x, doubleArray[doubleArrayIndex]); | |
4 | } | |
5 | noInline(exponentIsNonNanDouble1); | |
6 | ||
7 | function exponentIsNonNanDouble2(x, doubleArray) { | |
8 | return Math.pow(x, doubleArray[0]); | |
9 | } | |
10 | noInline(exponentIsNonNanDouble2); | |
11 | ||
12 | function testExponentIsDoubleConstant() { | |
13 | for (var i = 0; i < 10000; ++i) { | |
14 | var result = exponentIsNonNanDouble1(2, 0); | |
15 | if (result !== 21.112126572366314) | |
16 | throw "Error: exponentIsNonNanDouble1(2, 0) should be 21.112126572366314, was = " + result; | |
17 | } | |
18 | for (var i = 0; i < 10000; ++i) { | |
19 | var result = exponentIsNonNanDouble2(3, [-1.5]); | |
20 | if (result !== 0.19245008972987526) | |
21 | throw "Error: exponentIsNonNanDouble2(3, [-1.5]) should be 0.19245008972987526, was = " + result; | |
22 | } | |
23 | } | |
24 | testExponentIsDoubleConstant(); |