Debian Codegraph @

js/src/tests/test262/language/expressions/exponentiation/applying-the-exp-operator_A17.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 +0 and exponent > 0, the result is +0.
7 features: [exponentiation]
8 ---*/
9
10
11 var base = +0;
12 var exponents = [];
13 exponents[3] = Infinity;
14 exponents[2] = 1.7976931348623157E308; //largest finite number
15 exponents[1] = 1;
16 exponents[0] = 0.000000000000001;
17
18 for (var i = 0; i < exponents.length; i++) {
19 if ((base ** exponents[i]) !== +0) {
20 throw new Test262Error("(" + base + " ** " + exponents[i] + ") !== +0");
21 }
22 }
23
24 reportCompare(0, 0);