3 ms·
Why does the multiplication in "2x" have the same precedence as in "2 * x"? The previous poster is saying that the no-operator version binds stronger than the v
by dalke 15y ago
Why does the multiplication in "2x" have the same precedence as in "2 * x"? The previous poster is saying that the no-operator version binds stronger than the versions with operations. I agree that the no-symbol version has different rules than the explicit symbol.
Consider the expression "h-bar is h over 2 pi". That's "ħ = h/2π", and is definitely not the same as "(h/2) * π". This is because of the convention that you write the numerator terms and then the denominator terms. That is, if you wanted "h/2 * π" then you would tend to write it hπ/2.
As another example, consider Schrödinger's equation, with (-ħ²/2m) * Ψ(r, t). There too the 'm' is well-understood as being in the denominator.
- oddthink 15y agoExactly. This whole thing seems extremely artificial to me; notation is fluid and ambiguous, despite what elementary-school teachers may say. If you're calculating something, you can use whatever rules you want, and if you're reading some else's work, you can complain if they're being ambiguous. My intuitions (astrophysics/finance background) say multiplication-by-juxtaposition is higher-precedence than multiplication-by-symbol, so "x/y(1+y)" would be "x/(y(1+y))"; interpreting it as "(x/y)(1+y)" seems wrong. Then again, "x/y*(1+y)" already looks wrong. The solidus is too powerful. I'd write "(x/y)(1+y)" explicitly.