Geas MUD, enter the Aventure!
Geas Home | Play the Game

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.2.10 Precedence and Order of evalutaion

The table below summarizes the rules for precedence and associativity of all operators, including those which we have not yet discussed. Operators on the same line have the same precedence, rows are in order of decreasing precedence, so, for example, *, / and % all have the same precedence, which is higher than that of + and -.

Note that the precedence of the bitwise logical operators &, ^ and | falls below == and !=. This implies that bit-testing expressions like

 
if ((x & MASK) == 0) ...

must be fully parenthesized to give proper results.

  1. () [] Left to right

  2. ! ~ ++ -- - (type) * & Right to left

  3. * / % Left to right

  4. + - Left to right

  5. << >> Left to right

  6. < <= > >= Left to right

  7. == != Left to right

  8. & Left to right

  9. ^ Left to right

  10. | Left to right

  11. && Left to right

  12. || Left to right

  13. ?: Right to left

  14. = += == etc. Right to left

  15. , Left to right



This document was generated by Ronny Wikh on July, 8 2003 using texi2html