Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NOT OOO
#1
From the thread here, I had a couple of people message me about NOT and why I mentioned it was an oddball in the Order Of Operations (OOO).  Let me see if I can explain this simply, without confounding the issue..

Exponents are one of the first things we solve in our OOO.  Right?

And NOT is down near the end of our OOO.  Right?

So following those rules, write a program to parse and solve: 1 ^ NOT 2 ^ 3 AND 4

???   <-- Now how the heck DOES it calculate that???

The odd secret is NOT is both calculated FIRST, and near the LAST of our OOO.

Here's the trick I learned:  Put a beginning parentheses BEFORE your NOT, and the ending parentheses before any binary operators like AND, OR, EQV...

1 ^ NOT 2 ^ 3 AND 4 gets solved as:  1 ^ (NOT 2 ^ 3) AND 4

1 ^ (NOT 2 ^ 3) AND 4 makes sense to us.  Do the parentheses FIRST, even if NOT might be evaluated down low on the OOO.

You can't just say, "Solve it last," as sometimes, such as in this case, you have to solve it first before you can do the other operations.  1 raised to the WHAT power?   The (NOT 2 ^ 3)rd power!

Put a beginning parentheses BEFORE your NOT, and the ending parentheses before any binary operators like AND, OR, EQV.  <-- That's the rule for parsing and solving NOT properly.
Reply
#2
Vince will be sending you flowers any second now...

Pete
Reply




Users browsing this thread: 1 Guest(s)