addChecked method
- U64 other
Adds other catching overflow.
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);
}