I need help to convert a hex string to a hex string by applying a two-byte complement.
Example: 0x00FEB5AB → 0x00014A55
My hex. 00FF17DB →? (represents a negative latitude)
and 00FCFF75 →? (represents a negative length)
Thank you all.
I need help to convert a hex string to a hex string by applying a two-byte complement.
Example: 0x00FEB5AB → 0x00014A55
My hex. 00FF17DB →? (represents a negative latitude)
and 00FCFF75 →? (represents a negative length)
Thank you all.
A simple way could be to calculate the # > and add 1 as described in the entry Complement for two of wikipedia.
I say that it is a simple way because it is easy to calculate the complement of 1 , by applying the operation bitwise NOT to the value: