tests/auto/qml/ecmascripttests/test262/test/language/expressions/unary-minus/S11.4.7_A4.1.js
raw| 1 | // Copyright 2009 the Sputnik authors. All rights reserved. |
| 2 | // This code is governed by the BSD license found in the LICENSE file. |
| 3 | |
| 4 | /*--- |
| 5 | info: If x is NaN, operator -x returns NaN |
| 6 | es5id: 11.4.7_A4.1 |
| 7 | description: Checking NaN |
| 8 | ---*/ |
| 9 | |
| 10 | //CHECK#1 |
| 11 | if (isNaN(-NaN) !== true) { |
| 12 | $ERROR('#1: -NaN === Not-a-Number. Actual: ' + (-NaN)); |
| 13 | } |
| 14 | |
| 15 | //CHECK#2 |
| 16 | var x = NaN; |
| 17 | if (isNaN(-x) != true) { |
| 18 | $ERROR('#2: var x = NaN; -x === Not-a-Number. Actual: ' + (-x)); |
| 19 | } |