Configuration : Appendix - Virtual Field Expression Syntax : Numerical Operators
 
Numerical Operators
Numerical operators compose virtual field expressions to produce another valid virtual field expression. They are, by order of decreasing precedence:
Operator
Type
Description
-
unary
Minus operator
!
unary
Logical not. Returns 1 if expr is zero, whatever its type.
~
unary
bitwise not. Perform float-to-int conversion.
*, /, %
binary
Multiplication, division, modulo operators
+, -
binary
Addition, subtraction operators
<<, >>
binary
Left/right shift operators. These operators always perform float-to-int conversion if given float arguments. Same behavior as c++ signed shifts.
==, !=, >=, <=, >, <
binary
Comparison operators (Warning: = is NOT supported).
| (or), & (and), !^ (xor), ~ (not)
binary
Bitwise operators. These operators always perform float-to-int conversion if given float arguments.
&&, !||
binary
Logical and operators. Evaluation is lazy, meaning that the right side is not evaluated if the left size is false (resp. true).
expr ? expr
ternary
expr if/then/else operators
?=
binary
Fallback operator.
If the expression on the left has a value, use that value.
Else, use the value of the expression on the right. Evaluation is lazy.
For example, this is useful to define default values for fields or ranking elements. Example: @proximity?=3 + my_field?=2