Currently, AM uses a very primitive expression evaluator. It is slated for replacement very soon.
Comparisons return a one if true and a zero if false. The comparison operators are:
Symbol
|
Meaning
|
<
|
Is less than
|
>
|
Is greater than
|
<=
|
Is less than or equal to
|
>=
|
Is greater than or equal to
|
=
|
Is equal to
|
<>
|
Is not equal to
|
The arithmatic operators are:
Symbol
|
Meaning
|
+;
|
Addition
|
-;
|
Subtraction
|
*
|
Multiplication
|
/
|
Division
|
%
|
Modulus--the remainder after division
|
^
|
Exponent, the preceding number to the power of the following number
|
Log(x)
|
Natural logarithm of x (base e)
|
Log10(x)
|
Base 10 logarithm of x
|
rand(x)
|
Uniform random number, takes x as the seed
|
Parentheses should be used to group operations where the order of precedence is not clear. Suppose that you have variables A and B and you want to multiply them and square the result. You would write:
(A*B)^2
Of course, this is equal to:
A^2*B^2
since the standard order of precedence exponentiates first. For a square root of this we could write:
(A^2*B^2)^(1/2)