Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 10/7/2004 Posts: 38
|
If a PCF is formulated with a variety of different math operators (i.e. +, -,*, / ). And without using any parentheses. My question is: What is the order of priority as to which math operators are calculated first under the TC program? Merci beaucoup en avance!
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 4,308
|
I don't know this for sure, but after running a bunch of very simple tests, it appears as though the order is:
Division then multiplication then subtraction then addition.
I'll run this by my colleagues, and they can pipe up to confirm this, or to let you know if they know something different.
- Doug Teaching Online!
|
|
Registered User Joined: 1/1/2005 Posts: 2,645
|
Luv2,
See:
RULES TO LIVE BY when creating complex PCF's:
for the order of precedence.
Thanks, Jim Murphy
|
|
Registered User Joined: 3/7/2005 Posts: 23
|
QUOTE (Doug_H) I don't know this for sure, but after running a bunch of very simple tests, it appears as though the order is:
Division then multiplication then subtraction then addition.
I'll run this by my colleagues, and they can pipe up to confirm this, or to let you know if they know something different.
Doug,
I certainly hope not. Multiplication and division should have equal precedence, meaning whichever is on the left is done first. Addition and subtraction are the same. (That makes sense, considering that multiplication and division are the same thing, as are addition and subtraction.)
I don't think that it matters which order multiplication and division are done in if multiplication is on the left. (4*2)/3 = 4*(2/3). But if it's written the other way, the left-most rule applies, division is done first, and you get the correct answer: 4/2*3 = (4/2)*3 = 6. If you did the multiplication first, you'd get 2/3, which is wrong.
Rob
|
|
Registered User Joined: 10/7/2004 Posts: 38
|
Doug, Have you yet been able to run this matter by your colleagues? As you indicated above. Have you been able to confirm your original findings? Or have you now come to a different conclusion? Look forward to your response. Merci beaucoup en avance!
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The topic mentioned by bustermu has the correct information. Addition and subtraction are treated the same. Multiplication and division are treated the same but come before addition or subtraction.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |