Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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.

share|improve this question

marked as duplicate by Ross Millikan, J. M., Jennifer Dylan, sdcvvc, t.b. Aug 26 '12 at 18:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
Duplicates: here, here, and here –  process91 Aug 26 '12 at 15:48
1  
You are right that it is confusing and should therefore be avoided. I suspect that most people who write it are thinking $5/(7y)$. –  Ross Millikan Aug 26 '12 at 15:48
1  
"When there's doubt on how it's seen in others' eyes\always remember to parenthesize!" –  J. M. Aug 26 '12 at 15:50
2  
PARI interprets 5/7*x as (5/7)x, just as a point of reference. I personally think the notation without parentheses is ambiguous and should be avoided. –  KCd Aug 26 '12 at 15:51
1  
@Thomas: If you don't know how to get a symbol in LaTeX, Detexify is of great help. Assuming you meant the symbol $\div$, I've just used it to find that it is generated by the macro \div. –  celtschk Aug 26 '12 at 16:00
show 5 more comments

2 Answers

up vote 2 down vote accepted

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$.

share|improve this answer
    
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. –  user2468 Aug 26 '12 at 16:09
add comment

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}$$

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.