Originally posted by John Ryan:
Hi all,
When a left shift is performed on a byte it is first promoted to an int. When you want the result of the shifted byte value is it true that you must discard the top three bytes of the int result?. Is this because the top three bytes are used only for representing the sign of a byte or a short vaue?
This statement is confusing me because I thought the sign of a byte/short/int was only represented by the right most bit?
Cheers,
John
Thanks Stuart, I meant to say left most bit. Is the statement regarding the top three bytes true??