Performs overflow checking for Int/Long operations.
Performs overflow checking for Int/Long operations.
If no errors are detected, the expected result will be returned. If an error is detected, an ArithmeticOverflowException will be thrown.
Performs overflow checking for Int/Long operations.
Performs overflow checking for Int/Long operations.
If no errors are detected, the expected result will be returned in a Some wrapper. If an error is detected, None will be returned.
Performs overflow checking for Int/Long operations.
Performs overflow checking for Int/Long operations.
If no errors are detected, the expected result will be returned. If there are errors, the 'orElse' block will be evaluated and returned.
Performs overflow checking for Int/Long operations.
Performs overflow checking for Int/Long operations.
If no errors are detected, the expected result will be returned. If there are errors, the 'orElse' block will be evaluated and returned.
In the error case, this macro will actually evaluate a return statement in the outer method context. Thus, it should only be called from within a method that you would like to "return out of" in the case of an overflow.