Contents:
Compute the two’s complement of an integer value. For example, if value = 0b1010 and bitSize = 4, then the function will return 0b0110.
value = 0b1010
bitSize = 4
0b0110
value (int) – Input value.
int
bitSize (int) – Bit width of the value.
Two’s complement value.