Expand description
Arithmetic expression evaluation (is/2, comparisons).
Ported byte-for-byte from patch-prolog v1’s builtins.rs (eval_arith
plus the arith_* helpers). Semantics — floored mod, truncating //,
float-yielding /, checked i64 overflow, NaN/Infinity rejection, and
the exact zero-divisor labels — match v1 so error message text is
identical (verified against the v1 oracle; see unit tests).
NOTE on the immediate-integer range: cell INT is a 61-bit immediate
but eval computes in full i64. A result that fits i64 yet overflows
the i61 immediate cannot be boxed until M4; for M3 the is/2 ABI
reports it as an error (see pred::plg_rt_b_is). Evaluation itself
never narrows — it always works in i64.
Enums§
- Arith
Value - An evaluated arithmetic value: integer or float (mirrors v1 ArithVal).