Math-plan operations
The operations every host's math plan compiles, from the authored manifest
spec/math-ops.json (format: spec/math-ops.md). A pure-arithmetic subtree
made only of these, number literals and variables runs as a flat plan instead
of an AST walk; anything else in it becomes a leaf the plan evaluates the
ordinary way. Opcode numbers are each host's own and are not listed.
| Operation | Source | Operands | Error positions |
|---|---|---|---|
ADD |
binary + |
2 | the operator or call |
SUB |
binary - |
2 | the operator or call |
MUL |
binary * |
2 | the operator or call |
DIV |
binary / |
2 | the operator or call |
MOD |
binary % |
2 | the operator or call |
NEG |
prefix NEG |
1 | the operator or call |
ABS |
ABS(…) |
1 | the operator or call |
SIGN |
SIGN(…) |
1 | the operator or call |
CEIL |
CEIL(…) |
1 | the operator or call |
FLOOR |
FLOOR(…) |
1 | the operator or call |
TRUNC |
TRUNC(…) |
1 | the operator or call |
ROUND |
ROUND(…) |
2 | the call; argument 2 for its own errors |
POWER |
POWER(…) |
2 | the call; argument 2 for its own errors |
MIN |
MIN(…) |
1 or more, folded left to right | the operator or call |
MAX |
MAX(…) |
1 or more, folded left to right | the operator or call |
15 operations.