subChecked method

Uint64 subChecked(
  1. Uint64 other
)

Throws StateError instead of wrapping on underflow.

Implementation

Uint64 subChecked(Uint64 other) {
  if (other > this) throw IntegerError.overflow;
  return this - other;
}