Arithmetic operators affect the top two elements in the stack. The operands are popped and the result is pushed on to stack as the new first element. – (minus) subtracts the top element from the second element. / (slash) divides the second element by the top element.
The illustration below compares the use of arithmetic operators for the A and F codes.
Operation |
A Code |
F Code |
20 X 4 |
A;"20"*"4" |
F;C20;C4;* or F;"20";"4";* |
20 – 4 |
A;"20"–"4" |
;C20;C4;– or F;"20";"4";– |
20/4 |
A;"20"/"4" |
F;C20;C4;/ or F;"20";"4";/ |
See Also