js/src/tests/test262/ch08/8.5/S8.5_A11_T2.js

branch
TOR_BUG_3246
changeset 6
8bccb770b82d
equal deleted inserted replaced
-1:000000000000 0:2c11c833ef98
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 * The integer 0 has two representations, +0 and -0
6 *
7 * @path ch08/8.5/S8.5_A11_T2.js
8 * @description Compare positive_zero and negative_zero
9 */
10
11 var p_zero=+0;
12 var n_zero=-0;
13
14 //CHECK #1
15 if ((p_zero == n_zero) !== true){
16 $ERROR('#1: var p_zero=+0; var n_zero=-0; p_zero != n_zero');
17 }
18
19 //CHECK #2
20 if ((n_zero == 0) !== true){
21 $ERROR('#2: var p_zero=+0; var n_zero=-0; n_zero == 0');
22 }
23
24 //CHECK #3
25 if ((p_zero == -0) !== true){
26 $ERROR('#3: var p_zero=+0; var n_zero=-0; p_zero == -0');
27 }
28
29 //CHECK #4
30 if ((p_zero === 0) !== true){
31 $ERROR('#4: var p_zero=+0; var n_zero=-0; p_zero === 0');
32 }
33
34 //CHECK #5
35 if ((n_zero === -0) !== true){
36 $ERROR('#5: var p_zero=+0; var n_zero=-0; n_zero === -0');
37 }
38

mercurial