Subj : Re: bit shifting To : comp.programming From : Jon Harrop Date : Sun Aug 14 2005 06:49 pm Rob Somers wrote: > Sorry, I was in a rush when I asked my question. I am not understanding > what the difference between the 1111111 (127) and 01111111 (from 127 & > 255) - obviously 1111111 is not 01111111, but I thought the leading 0 did > not count for anything. I don't think you've read Alex's post carefully enough. By the looks of it, you wrote your code wrongly because you thought a "short" was 8 bits when it is actually 16 bits. So your "~x" is not 127. -- Dr Jon D Harrop, Flying Frog Consultancy http://www.ffconsultancy.com .