posted 19 years ago
Convert to binary and take the 8 least significant bits as signed:
989 decimal = 1111011101 binary. the least significant 8 bits are
11011101 which is -35 decimal.
Upon experimentation, and with absolutely no proof whatsoever, in the cases here, you can continually subtract 256 until you are in the range of -128 to 127. That may be easier if it is correct.
[ May 10, 2005: Message edited by: Timmy Marks ]