Possible Duplicate:
What is 48÷2(9+3)?
Hi all
I don't know if anyone has seen this question floating around Facebook, but me and a friend are a little conflicted.
The question is: $6 \div 2(1+2) = ?$
Should this be interpreted as $\frac{6}{2(1+2)} = 1$, or $\frac{6}{2} \times (1+2) = 9$?
I went with the first, using programming operator precedence. My friend, however, went for the second, saying "In algebra, bracket multiplication binds more tightly than explicit multiplication".
What I'd like to know is, what is the answer to this simple equation in programming terms and algebra terms, or are they exactly the same?
Thanks very much,
James