Macro Operators
Operators allow mathematical calculations, logical comparisons, and data manipulations in macros.
Arithmetic Operators
| Operator |
Function |
Example |
| + | Addition | #1 = #2 + #3 |
| - | Subtraction | #1 = #2 - #3 |
| * | Multiplication | #1 = #2 * #3 |
| / | Division | #1 = #2 / #3 |
| MOD | Modulo (remainder) | #1 = #2 MOD #3 |
Mathematical Functions
| Function |
Description |
Example |
| SIN[x] | Sine (degrees) | #1 = SIN[45] |
| COS[x] | Cosine (degrees) | #1 = COS[45] |
| TAN[x] | Tangent (degrees) | #1 = TAN[45] |
| SQRT[x] | Square root | #1 = SQRT[100] |
| ABS[x] | Absolute value | #1 = ABS[-5] |
| ROUND[x] | Rounding | #1 = ROUND[3.7] |
Comparison Operators
| Operator |
Meaning |
| EQ | Equal to (=) |
| NE | Not equal (≠) |
| GT | Greater than (>) |
| GE | Greater or equal (≥) |
| LT | Less than (<) |
| LE | Less or equal (≤) |
Logical Operators
- AND: Logical AND
- OR: Logical OR
- XOR: Exclusive OR
Examples
; Calculate radius from coordinates
#10 = SQRT[[#1*#1] + [#2*#2]]
; Calculate angle
#11 = ATAN[#2]/[#1]
; Compound condition
IF [[#1 GT 0] AND [#1 LT 100]] GOTO 10