HPlogo System Debug Reference Manual > Chapter 2 User Interface

Operator Precedence

MPE documents

Complete PDF
Table of Contents
Index

E0201 Edition 4 ♥
E0300 Edition 3
E0692 Edition 3

The precedence ranking of an operator determines the order in which it is evaluated in an expression. The levels of ranking are:

Table 2-6 Operator Precedence

Precedence Operators
highest[ ]
. NOT, BNOT
. <<, >>, BAND, BOR
. *, /, MOD, AND
. +, -, OR
lowest<, <=, =, >, >=, <>

Operators of highest precedence are evaluated first. For example, since * ranks above +, the following expressions are evaluated identically:

   (x + y * z)    and    (x + (y * z))

When operators in a sequence have equal precedence, evaluation proceeds from left to right. For example, each of the following expressions are evaluated identically:

   (x + y + z)    and    ((x + y) + z)




Expressions


Variables