N
Nishu
Harald said:If you care about the bit pattern, you probably shouldn't be using
signed integers anyway.
Yes, since most of the processors consider 2's complement signed
integers implementation, my interest is in relation to that only. (i =
((unsigned)i) >> 4
signed arithmetic. Since, as C is flexible for >> operation on signed
integers, C compilers come up >> as arithmetic right shift, maintaining
the sign of the number while shifting and in case you need padding of
0s in MSBs for specific applications, just type CAST it to unsigned !!
Thanks a lot.
-Nishu