jrlen balane <[EMAIL PROTECTED]> writes: > would i be able to perform bitwise operation with the result? > say, i want to get the two's complement of the result, is this correct: > > twos_complement = (~ hex(hi + lo)) + 1
You can do bit operations, but hex(n) is the hex string for n, which is not what you want. If you want the hex form of the two's complement, just say hex(-(hi+lo) & 0xff) assuming you want one byte, or hex(-(hi+lo) & 0xffff) for two bytes. -- http://mail.python.org/mailman/listinfo/python-list