mulChecked method

U32 mulChecked(
  1. U32 other
)

Multiplies by other catching overflow.

Implementation

U32 mulChecked(U32 other) {
  var result = value * other.value;
  if (result > 4294967295) {
    throw StateError('U32 multiplication overflow');
  }
  return U32(result);
}