Hi everyone,

Is bit shift operation, left and right, in T2 logical or arithmetic? What
are the results for the following statements and why?
statement 1:
(-1) << 2;


statement 2:
(-127) << 1;


statement 3:
int8_t a = -127;  //binary form: 10000001
int8_t b = a << 1;
Is 'b' equal to 2 (00000010)? If yes, we shift a negative number into a
positive one?


Thanks in advance.

--
-TelosB
-Xiaohui Liu
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to