| 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 and exponent is not an odd integer, the result is +∞. |
| 7 |
---*/ |
| 8 |
|
| 9 |
|
| 10 |
var base = -0; |
| 11 |
var exponents = []; |
| 12 |
exponents[4] = -0.000000000000001; |
| 13 |
exponents[3] = -2; |
| 14 |
exponents[2] = -Math.PI; |
| 15 |
exponents[1] = -1.7976931348623157E308; //largest (by module) finite number |
| 16 |
exponents[0] = -Infinity; |
| 17 |
|
| 18 |
for (var i = 0; i < exponents.length; i++) { |
| 19 |
if ((base ** exponents[i]) !== +Infinity) { |
| 20 |
$ERROR("(" + base + " ** " + exponents[i] + ") !== +Infinity"); |
| 21 |
} |
| 22 |
} |