Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/exponentiation/applying-the-exp-operator_A12.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 base is +∞ and exponent < 0, the result is +0.
7 ---*/
8
9
10 var base = +Infinity;
11 var exponents = [];
12 exponents[0] = -Infinity;
13 exponents[1] = -1.7976931348623157E308; //largest (by module) finite number
14 exponents[2] = -1;
15 exponents[3] = -0.000000000000001;
16
17 for (var i = 0; i < exponents.length; i++) {
18 if ((base ** exponents[i]) !== +0) {
19 $ERROR("(" + base + " ** " + exponents[i] + ") !== +0");
20 }
21 }