addChecked method

I32 addChecked(
  1. I32 other
)

Adds other catching overflow.

Implementation

I32 addChecked(I32 other) {
  var result = value + other.value;
  if (result > 2147483647 || result < -2147483648){
    throw StateError('I32 addition overflow');
  }
  return I32(result);
}