Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/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 ---*/
8
9 var exponent = NaN;
10 var bases = [];
11 bases[0] = -Infinity;
12 bases[1] = -1.7976931348623157E308; //largest (by module) finite number
13 bases[2] = -0.000000000000001;
14 bases[3] = -0;
15 bases[4] = +0
16 bases[5] = 0.000000000000001;
17 bases[6] = 1.7976931348623157E308; //largest finite number
18 bases[7] = +Infinity;
19 bases[8] = NaN;
20
21
22 for (var i = 0; i < bases.length; i++) {
23 assert.sameValue(
24 bases[i] ** exponent,
25 NaN,
26 bases[i] + " ** " + exponent
27 );
28 }