Vai al contenuto

Operator Precedence Rules

Operators have different levels of precedence, as specified in the table of operators. The operator with highest precedence in an expression is applied first, followed by the operator of next lower precedence, etc., until evaluation is complete. Operators of equal precedence are applied as written in the expression from left to right.For example if A, B, C, and D are of type INT with values 1, 2, 3, and 4, respectively, then:A+B-C*ABS(D)yields -9, and:(A+B-C)*ABS(D)yields 0.When an operator has two operands, the leftmost operand is evaluated first. For example, in the expressionSIN(A)*COS(B)the expression SIN(A) is evaluated first, followed by COS(B), followed by evaluation of the product.Functions are invoked as elements of expressions consisting of the function name followed by a parenthesized list of arguments, as defined in the relevant section.