twocomp8 function

int twocomp8(
  1. int value
)

Calculates 2s complement of an 8-bit value.

Implementation

int twocomp8(int value) => -(value & 0x80) + (value & ~0x80);