subChecked method

I8 subChecked(
  1. I8 other
)

Subtracts another I8 from this, throwing a StateError on overflow or underflow.

Implementation

I8 subChecked(I8 other) {
  var result = value - other.value;
  if (result > 127 || result < -128) {
    throw StateError('I8 subtraction overflow');
  }
  return I8(result);
}