checkedAdd (Function)
Signature: checkedAdd(a: int, b: int) -> Result<int, Error>
Description: Named overflow-checked integer addition, returning Result<int, Error>.
Parameters
- a (int): The first addend
- b (int): The second addend
Returns: Result<int, Error>
Example
let t = checkedAdd(a: 9223372036854775807, b: 1) ?: 0 // 0 — overflow reported
t = checkedAdd (a: 9223372036854775807, b: 1) ?: 0 // 0 — overflow reported