mulChecked method

Uint64 mulChecked(
  1. Uint64 other
)

Throws IntegerError instead of wrapping on overflow.

Implementation

Uint64 mulChecked(Uint64 other) {
  if (isZero || other.isZero) return Uint64.zero;
  final r = this * other;
  if (r ~/ other != this) throw CoreErrors.integerOverflow;
  return r;
}