This Chapter provides a full explanation of using standard mathematical and trigonometric functions, as well an insight into how AMOS Professional exploits numbers.
Nothing could be simpler than asking AMOS Professional to run this sum:
D> Print 2+2
Arithmetical operations are straightforward, provided the correct symbols are used, as follows:
+ the plus sign always signals addition
- the minus sign is used for subtraction
* for multiplication, an asterisk character must be used
/ divisions are made using the forward-slash symbol
^ the circumflex character is used as the exponential symbol, and it means "raise this number to a given power", which is exactly the same as multiplying a number with itself.
So the following two lines are interchangable:
D> Print 3^5 Print 3*3*3*3*3
The following logical operations can also be used in calculations:
MOD is the "modulo" operator, which acts as a constant multiplier. AND, OR and XOR are the three logical operations.
Arithmetical instructions are taken literally, using a set of built-in priorities. So the following lines give the results 6 and 8 respectively:
D> Print 2+2*2 Print (2+2)*2
AMOS Professional handles a combination of calculations that make up an "expression" in the following strict order of priority:
Any calculation placed inside a pair of round brackets is evaluated first, and treated as a single number.