HPlogo System Debug Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 2 User Interface

Operator Precedence

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

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

PrecedenceOperators
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)


Feedback to webmaster