On Wed, Oct 29, 2008 at 4:17 AM, James <[EMAIL PROTECTED]> wrote: > can anybody tell me how to convert int value to short since normal > type-casting would return diff value (im not familiar with bit-shift, etc.) >
It's... it's called the pigeonhole principle. You have too many things to put into too few slots. A short can only hold one of 65,536 distinct values, whereas an int can hold over 4 billion. You just can't put 4 billion things into 65,536 slots. So yes, for all but numbers in the range that a short can hold, casting will give you a different value.
