Operator precedence

When several operations occur in an expression, KiXtart evaluates and resolves each part of the expression in a predetermined order. This predetermined order is known as operator precedence.

 

Parentheses can be used to override the order of precedence and force some parts of an expression to be evaluated before other parts. Operations within parentheses are always performed before those outside the parentheses. Within parentheses standard operator precedence is maintained.

 

The precedence of operators affects the grouping and evaluation of operands in expressions. Expressions with higher-precedence operators are evaluated first.

 

The following table summarizes the precedence of the supported operators, listing them in order of precedence from highest to lowest. Where several operators appear together, they have equal precedence and are evaluated from left to right.

 

Operator

Type of operation

[ ] ( ) .

Expression

+ - ~ NOT

Unary

* / mod

Multiplicative

+ - ^

Addition

< > <= >=

Relational

= ==

Equality

AND OR

Logical AND, logical OR