Debian Codegraph @

js/src/tests/test262/language/expressions/exponentiation/applying-the-exp-operator_A1.js

raw
1 // Copyright 2016 Rick Waldron. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 esid: sec-applying-the-exp-operator
6 description: If exponent is NaN, the result is NaN.
7 features: [exponentiation]
8 ---*/
9
10 var exponent = NaN;
11 var bases = [];
12 bases[0] = -Infinity;
13 bases[1] = -1.7976931348623157E308; //largest (by module) finite number
14 bases[2] = -0.000000000000001;
15 bases[3] = -0;
16 bases[4] = +0
17 bases[5] = 0.000000000000001;
18 bases[6] = 1.7976931348623157E308; //largest finite number
19 bases[7] = +Infinity;
20 bases[8] = NaN;
21
22
23 for (var i = 0; i < bases.length; i++) {
24 assert.sameValue(
25 bases[i] ** exponent,
26 NaN,
27 bases[i] + " ** " + exponent
28 );
29 }
30
31 reportCompare(0, 0);