At 13:13 28/01/2009 -0500, Gene Young wrote:
Brian Barker wrote:
At 07:58 28/01/2009 -0500, Gene Young wrote:
... enter the formula as =(D1+200) -Note the parentheses.
I've noted the parentheses - but what do they do, please? (I hope the answer is "nothing".)

They group functions together. It says to add the D1 value and 200 before doing anything else with this information. It probably won't affect this simple equation but it is a good habit to get into for when you start creating more complex equations.

But the point is that here there *is* nothing else to be done in your expression. *In this case*, the parentheses have no purpose. You are using them to insist that the addition is done first, before ... er, nothing else. (And there is no "probably" about it.)

An example of this is =INT((D2 + (0.25*D2))) ...
You may be catching parenthesesitis.  Try:
     =INT(D2 + 0.25*D2)

There should have only been two sets like =INT(D2 + (0.25*D2))
This tells Calc to multiply D2 by 0.25 before the addition rather than D2 + 0.25 times D2.

The inner set are still unnecessary, since multiplications are done before additions: this is a basic rule of mathematics. Only the outer set are necessary, as part of the function reference.

Hope this clarifies.

There is an argument (to which I subscribe) that including unnecessary parentheses only complicates reading of and thus understanding of expressions. You wouldn't do it in mathematics: you would write 2(x+y) but 2xy, not 2(xy). If you include unnecessary parentheses, you very quickly create expressions that have so many they become unreadable and difficult to debug. You suggest this is "a good habit", but I suggest it can be a bad one.

Brian Barker


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to