mulChecked method

I8 mulChecked(
  1. I8 other
)

Multiplies this by another I8, throwing a StateError on overflow or underflow.

Implementation

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