I dunno... You two...
I am quite well aware that the parenthesis (brackets!!) make no difference
in this specific instance.
I am also allowing for the possibility that the user may add just a few more
operations to his formula. Since I can't tell what those operations may be,
I added brackets just so there are no inconvenient side-effects.
I often use prophylactic parentheses in my own formulae, simple to avoid
unforseen side-effects as things get more complex. Unneeded brackets never
hurt, omitted ones can hurt big time, and take ages to debug.
Cheers
Perhaps John should be sent back to Algebra I for a quick review of the
Order of Operations ;-) In this case the grouping doesn't hurt, but it is
unnecessary & therefore redundant.
Multiplication & Division are equal in priority, so if that's the extent of
the equation it makes no difference what order it's written. I.E.:
10*120/113 = 10.61946903
120/113*10 = 10.61946903
120*10/113 = 10.61946903
10/113*120 = 10.61946903
etc.
No brackets ('parentheses' to us Yanks) are required for grouping the
operations. Addition & Subtraction, however, are lesser priority than
Multiplication & Division, so grouping would have an impact on the result.
I.E.:
7+3*5 = 22
but
(7+3)*5 = 50
--
The email below is my business email -- Please do not email me about forum
matters unless I ask you to; or unless you intend to pay!
John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. | Ph: +61 (0)4 1209 1410 | mailto:
[email protected]