mirror of
https://github.com/tc39/test262.git
synced 2025-05-03 22:40:28 +02:00
The global isNaN is not precise at all, and Number.isNaN is an ES6 feature that makes it preferrable to use assert's sameValue for NaN values, as it handles it internally using the comparison.
22 lines
457 B
JavaScript
22 lines
457 B
JavaScript
// Copyright 2016 Rick Waldron. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
esid: sec-applying-the-exp-operator
|
|
description: If abs(base) is 1 and exponent is −∞, the result is NaN.
|
|
---*/
|
|
|
|
|
|
var exponent = -Infinity;
|
|
var bases = [];
|
|
bases[0] = -1;
|
|
bases[1] = 1
|
|
|
|
for (var i = 0; i < bases.length; i++) {
|
|
assert.sameValue(
|
|
bases[i] ** exponent,
|
|
NaN,
|
|
bases[i] + " ** " + exponent
|
|
);
|
|
}
|