sgs_ArithOp [function]
void sgs_ArithOp( sgs_Context* C, sgs_Variable* out, sgs_Variable* A, sgs_Variable* B, int op )
Perform the specified operation on variables A and B, returning the value on out
.
This function prints errors, exactly like VM would (internally there are the same functions).
- This function can perform 6 operations, which are specified by passing the following values to
op
:- SGS_EOP_ADD: +
- SGS_EOP_SUB: - (binary)
- SGS_EOP_MUL: *
- SGS_EOP_DIV: /
- SGS_EOP_MOD: %
- SGS_EOP_NEGATE: - (unary, uses only
A
)