subChecked method

Uint64 subChecked(
  1. Uint64 other
)

Throws IntegerError instead of wrapping on underflow.

Implementation

Uint64 subChecked(Uint64 other) {
  if (other > this) throw CoreErrors.integerOverflow;
  return this - other;
}