1

Possible Duplicate:
Do values attached to integers have implicit parentheses?
What is 48÷2(9+3)?
What is “multiplication by juxtaposition”?

What is the precedence of the concatention operator when used for multiplication?

If it's the same as multiplication, 5/7y would mean (5/7)*y.

However, it also seems reasonable to see it as 5/(7*y).

I realize I can avoid the issue by writing "5y/7" or using explicit parentheses, but am curious about the "correct" answer.

Googling was surprisingly unhelpful: most results were about the precedence of string concatention in programming languages.

2 Answers2

1

I think that you almost answered your own question:

I realize I can avoid the issue by writing "5y/7" or using explicit parentheses.

I don't know of any "correct" way to interpret $5/7y$, and I don't believe that there is any. There are lots of notations in math that are not that clear, and the only answer is to make them clear. So I would never write $5/7y$ on a blackboard if I meant $5/(7y)$.

If you by $5/7y$ mean $5/7*y$, then from what I understand, when programming a compiler would interpret this as $5*y/7$.

Thomas
  • 43,555
  • Actually in the vast majority of programming languages, 5/7y would simply be a syntax error, because multiplication needs generally be explicitly written with *. In C++11 it could, however, denote the division of the standard integer 5 by a user-defined numeric literal 7y (which most likely will be the number 7 represented by an user-defined numeric type). Indeed, the only programming language I know where juxtaposition is interpreted as multiplication is Mathematica's; here indeed 5/7y means $(5/7)y$. – celtschk Aug 26 '12 at 15:56
  • @celtschk: You are right! I will edit – Thomas Aug 26 '12 at 15:58
  • Speaking of Mathematica, IIRC Singular also interprets juxtaposition as multiplication. –  Aug 26 '12 at 16:09
1

I believe concatenation strictly applies to the joining of two strings together. I would imagine that extending this to mathematical operations there would be parenthesis around the objects in order to avoid ambiguity, ie $$ 5/7 * y/x $$ would yield $$\dfrac{5}{7}\cdot\dfrac{y}{x}$$