tests/basic/bitops.sp
changeset 207 04ce04a54936
parent 8 069d207a8f2a
child 215 b8f650a441a5
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tests/basic/bitops.sp	Sat Nov 17 20:23:36 2012 -0800
     1.3 @@ -0,0 +1,16 @@
     1.4 +native PrintNum(num);
     1.5 +
     1.6 +main()
     1.7 +{
     1.8 +    new result = 5192342;
     1.9 +    for (new i = 0; i < 1000; i = i + 1) {
    1.10 +        result = result | i;
    1.11 +        result = result & 9129345;
    1.12 +        result = result ^ (i * 73);
    1.13 +
    1.14 +        new bit = result & 1;
    1.15 +        result = (result >>> 1) | (bit << 31);
    1.16 +        result = result | (i >> 6);
    1.17 +    }
    1.18 +    PrintNum(result);
    1.19 +}