To add a note to Luke's list here: NOT is a weird beast with regards to order of operations, as it resolves itself depending on what's to the left and right of it.
For instance: 3 * NOT 1 - 1
We do multiplication before NOT. Right?
Not in this case!!
NOT is a special beast which evaluates itself as if it was in parenthesis from the point directly before it to every point after it but before any other binary operators. (If you guys can wrap your minds around what I'm trying to say here.)
Let me illustrate with a few examples:
3 * NOT 1 -1 evaluates as 3 * (NOT 1 - 1).
3 * NOT 1 -1 AND 2 evaluates as 3 * (NOT 1 -1) AND 2.
1 ^ 4 + 3 * NOT 1 - 1 * 2 ^ 4 OR 5 evaluates as 1 ^ 4 + 3 * (NOT 1 - 1 * 2 ^ 4) OR 5.
NOT is actually resolved FIRST, but only up to the point where it's interrupted by a binary operator such as AND, OR, XOR.
NOT's a complex little bugger to wrap your head around, when it comes to order of precedence, and the best way I've learned to process it is to encase it in parenthesis as I illustrated above with any evaluator program. Start parenthesis right before the NOT, end it at the end of the formula or whenever AND, OR, XOR, EQV, IMP appears in the code.
Try it yourself for a bit, if you want to see how odd it is. Start with a simple little 3 * NOT 1 - 1.
If multiplication went first, wouldn't we resolve it as:
(3 * NOT 1) - 1
(3 * -2) - 1
-6 -1
-7
That's NOT the answer however. Instead, it's resolved as I mentioned:
3 * (NOT 1 - 1)
3 * (NOT 0)
3 * (-1)
-3
A special case which one has to juggle around if they're going to make an evaluator, or else you're NOT going to get the correct answer. :P