XGen expression operators

The following arithmetic operators are supported by XGen expressions.

Operator Description
+ Add
- Subtract
* Multiply
/ Divide
% Modulus: Same as fmod() (see XGen expression functions)
^ Exponent: Same as pow() (see XGen expression functions)
[x,y,z] Vector constructor
V[n] Vector component access, where n must be 0, 1, or 2.
x ? y : z Conditional operator (if x then y else z)
x && y AND comparison
x || y OR comparison
x == y Equality test: Compares all three components.
x != y Inequality test
x > y Comparison, which uses [0] component of the vectors.
x < y Comparison, which uses [0] component of the vectors.
x >= y Comparison, which uses [0] component of the vectors.
x <= y Comparison, which uses [0] component of the vectors.
!x Logical negation
-> Applies the function on the right to the expression on the left.

Any level of parentheses may be used to clarify order of evaluation. An expression can be followed by the pound sign (for example, “#”) to signal its end. Therefore, you can put comments, or alternate versions of your expression, after the pound sign.