| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
gTestfile = '11.4.7-02.js'; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
var SECTION = "11.4.7"; |
| 15 |
var VERSION = "ECMA"; |
| 16 |
var TITLE = "Unary - Operator"; |
| 17 |
var BUGNUMBER = "432881"; |
| 18 |
|
| 19 |
startTest(); |
| 20 |
|
| 21 |
test_negation(0, -0.0); |
| 22 |
test_negation(-0.0, 0); |
| 23 |
test_negation(1, -1); |
| 24 |
test_negation(1.0/0.0, -1.0/0.0); |
| 25 |
test_negation(-1.0/0.0, 1.0/0.0); |
| 26 |
|
| 27 |
|
| 28 |
test_negation(1073741824, -1073741824); |
| 29 |
test_negation(-1073741824, 1073741824); |
| 30 |
|
| 31 |
|
| 32 |
test_negation(1073741823, -1073741823); |
| 33 |
test_negation(-1073741823, 1073741823); |
| 34 |
|
| 35 |
|
| 36 |
test_negation(1073741824, -1073741824); |
| 37 |
test_negation(-1073741824, 1073741824); |
| 38 |
|
| 39 |
|
| 40 |
test_negation(1073741823, -1073741823); |
| 41 |
test_negation(-1073741823, 1073741823); |
| 42 |
|
| 43 |
|
| 44 |
test_negation(2147483648, -2147483648); |
| 45 |
test_negation(-2147483648, 2147483648); |
| 46 |
|
| 47 |
|
| 48 |
test_negation(2147483647, -2147483647); |
| 49 |
test_negation(-2147483647, 2147483647); |
| 50 |
|
| 51 |
function test_negation(value, expected) |
| 52 |
{ |
| 53 |
var actual = -value; |
| 54 |
reportCompare(expected, actual, '-(' + value + ') == ' + expected); |
| 55 |
} |