Arithmetic Operators examples
Download this program:
StandAloneArithmeticOperatorsExamples.PRG
Example Program
Results
As expected, the operators +, -, and * perform addition, subtraction, and multiplication. In a normal calculation, 9/4 = 2.25. However, the program outputs 2. This is because the only variables available in the A script are integer values. Therefore, the output will be an integer. The compiler ignores the decimal term and produces an answer of 2 instead of 2.25.
The modulo % operator computes the remainder: a=9 divided by b=4 yields a remainder of 1.