Expressions¶
Expressions can contain literal values, identifiers (constants, formulas,
local and global variables) and operators. Literals for Booleans, integers and
doubles are written in the standard way: true
, false
, 4
, 3.14
.
Operators¶
The following operators can be used in expressions, ordered by their precedence (most strongly binding operators first):
[...]
,.
,(...)
(array indexing, member access, function call)-
(unary minus)*
,/
(multiplication, division)+
,-
(addition, subtraction)>
,>=
,<
,<=
(relational operators)=
,!=
(equality operators)!
(unary negation)&
(logical and)|
(logical or)=>
(implication)... ? ... : ...
(ternary if-then-else)
Built-in functions¶
The following built-in functions are provided:
min(x, y, ...)
andmax(x, y, ...)
which select the minimum or maximum of two or more numbers, respectively.floor(x)
andceil(x)
which roundx
up and down, respectively, to the nearest integer.pow(x, y)
which computesx
to the power ofy
.mod(i, n)
for integer modulo.log(x, b)
which computes the logarithm ofx
to baseb
.active(f)
returnstrue
if the featuref
is in the current feature combination.iactive(f)
returns1
if the featuref
is in the current feature combination, and0
otherwise.