addChecked method
- I16 other
Adds another I16 to this, throwing a StateError on overflow or underflow.
Implementation
I16 addChecked(I16 other) {
var result = value + other.value;
if (result > 32767 || result < -32768) {
throw StateError('I16 addition overflow');
}
return I16(result);
}