addChecked method

U64 addChecked(
  1. U64 other
)

Implementation

U64 addChecked(U64 other) {
  var result = (value + other.value).toUnsigned(64);
  if (result < value || result < other.value) {
    throw StateError('U64 addition overflow');
  }
  return U64(result);
}