binaryOp
function binaryOp( l, r, op, bigOp?, symbolicOp?): Value;Defined in: packages/engine/src/vm/VMConversion.ts:253
Apply a numeric binary operation with type-aware dispatch. Handles BigInt, UoM, Vector, Symbolic, and plain Number operands.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
l | Value | - |
r | Value | - |
op | (a, b) => number | - |
bigOp? | (a, b) => bigint | - |
symbolicOp? | "sub" | "add" | "mul" | "div" | which SymbolicNode kind to build when either operand is Symbolic (symbolic/SymbolicNode.ts). Only ADD/SUB/MUL/DIV pass this (the “four arithmetic opcodes” the symbolic-algebra phase scopes itself to), MOD’s own call site passes nothing, so a Symbolic operand there falls through to the ordinary numeric path (toNumber() -> 0), an explicit, disclosed scope boundary rather than an oversight. |