Error handling rules¶
All core numeric types avoid exceptions.
Err¶
None: value is validInvalid: parse failure / invalid inputOverflow: exceeds limits or internal operation overflowDivByZero: division by zero
Propagation¶
- If an operand is in error state, operators return that operand (first error wins).
- Comparisons on invalid values are not meaningful; prefer
ok()checks before comparing.
Conversions¶
Numeric128::checked()returnsstd::expected<Numeric128, Err>.Numeric::parse_checked()andNumeric::from_int64_checked()returnstd::expected<Numeric, Err>.