js/src/tests/test262/ch09/9.5/S9.5_A2.1_T2.js

branch
TOR_BUG_3246
changeset 6
8bccb770b82d
equal deleted inserted replaced
-1:000000000000 0:533828defb62
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 * ToInt32 returns values between -2^31 and 2^31-1
6 *
7 * @path ch09/9.5/S9.5_A2.1_T2.js
8 * @description Converting some numbers, which are in\outside of Int32 scopes, with ~ operator
9 */
10
11 // CHECK#1
12 if (~-2147483649 !== ~2147483647) {
13 $ERROR('#1: ~-2147483649 === ~2147483647');
14 }
15
16 // CHECK#2
17 if (~-4294967296 !== ~0) {
18 $ERROR('#2: ~-4294967296 === ~0');
19 }
20
21 // CHECK#3
22 if (~2147483648 !== ~-2147483648) {
23 $ERROR('#3: ~2147483648 === ~-2147483648');
24 }
25
26 // CHECK#4
27 if (~4294967296 !== ~0) {
28 $ERROR('#4: ~4294967296 === ~0');
29 }
30

mercurial