Tuesday, February 06, 2018

[msquaaah] Precedence of equality and boolean operators

Some expressions to measure the relative precedence of equality versus boolean operators, in a language like C where 0 and 1 are false and true.  The first of the easiest to remember.

  • 0 == 0 && 0
  • 0 == 0 || 1
  • 0 == 1 || 1
  • 0 == 1 && 0

No comments :