Variable expressions can use normal arithmetic and relational operators as well as parentheses to specify the order and precedence of the operations.
Note: Using parenthesis in expressions can cause syntax errors in the preprocessor statements. All preprocessor directives are surrounded by a "((" on the left and "))" on the right. They must be on the same line.
For Example:
(( A + (B - ((X - 5) % Y)) % Z ))
will not work because the internal double parentheses are not separated. Instead use:
(( A + (B - ( (X - 5) % Y) ) % Z ))
Expression operators
Operator |
Alternate |
Description |
A + B |
N/A |
Evaluates to the sum of A and B |
A - B |
N/A |
Evaluates to the difference between A and B |
A * B |
N/A |
Evaluates to the product of A and B |
A / B |
N/A |
Evaluates to the quotient of A and B |
A < B |
A .LT. B |
Evaluates to true if A is less than B |
A > B |
A .GT. B |
Evaluates to true if A is greater than B |
A <= B |
A .LE. B |
Evaluates to true if A is less than or equal to B |
A >= B |
A .GE. B |
Evaluates to true if A is greater than or equal to |
A = = B |
A .EQ. B |
Evaluates to true if A is equal to B |
A != B |
A .NE. B |
Evaluates to true if A is not equal to B |
A % B |
N/A |
Evaluates to the integer remainder of B and A |