Arithmetic operations
| 384 | |
| 385 | // Arithmetic operations |
| 386 | ScriptNumResult safeAdd(int64_t x) const noexcept |
| 387 | { |
| 388 | const bool overflow = __builtin_add_overflow(_value, x, &x); |
| 389 | if (overflow) |
| 390 | { |
| 391 | return boost::none; |
| 392 | } |
| 393 | return fromInt(x); |
| 394 | } |
| 395 | |
| 396 | ScriptNumResult safeAdd(CScriptNum const &x) const noexcept { return safeAdd(x._value); } |
| 397 |
no outgoing calls