addChecked method

Int32 addChecked(
  1. Int32 other
)

Implementation

Int32 addChecked(Int32 other) {
  final r = toInt() + other.toInt(); // both safe magnitudes, sum safe too
  if (r < -0x80000000 || r > 0x7FFFFFFF) throw IntegerError.overflow;
  return Int32(r);
}