addChecked method

Uint64 addChecked(
  1. Uint64 other
)

Throws StateError instead of wrapping on overflow.

Implementation

Uint64 addChecked(Uint64 other) {
  final r = this + other;
  if (r < this) throw IntegerError.overflow;
  return r;
}