Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Order of operations in boolean algebra

  1. Feb 4, 2013 #1
    I have a rather technical question in boolean algebra to which I was not able to find an answer.

    What is the order of operations in boolean algebra?
    Is it first logical NOT, logical AND, logical OR, and finally logical XOR?

    Correct me if I am wrong.

  2. jcsd
  3. Feb 4, 2013 #2
  4. Feb 4, 2013 #3
    What about XOR?

  5. Feb 4, 2013 #4

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    Since xor is equivalent as not equals, at least in C-based languages xor (as !=) has precedence over logical and (&&) and logical or (||). However, bitwise and (&) has precedence over bitwise xor (^), which in turn has precedence over bitwise or (|).

    In the end, does it really matter? Just use parentheses and there's no doubt.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: Order of operations in boolean algebra
  1. Boolean Algebra (Replies: 1)