From: "alexeymuranov (Alexey Muranov)" Date: 2012-11-12T01:35:01+09:00 Subject: [ruby-core:49225] [ruby-trunk - Feature #7328] Move ** operator precedence under unary + and - Issue #7328 has been updated by alexeymuranov (Alexey Muranov). trans (Thomas Sawyer) wrote: > @alexeymuranov > > -2 * -2 = 4 This is not the same, and I do not agree with this either. In my opinion, "-2 * -2" is not a legal syntax (the "*-" part), it should be (-2)*(-2) or -2*(-2) = - (2*(-2)). Tomas, can you find a printed or otherwise confirmed example where an expression with parentheses like "-(2^2)" or "-(e^x)" or "-(x^2)" is used? ---------------------------------------- Feature #7328: Move ** operator precedence under unary + and - https://bugs.ruby-lang.org/issues/7328#change-32783 Author: boris_stitnicky (Boris Stitnicky) Status: Open Priority: Normal Assignee: Category: Target version: I would like to ask to consider decreasing ** operator precedence just below that of -/+ unary operators. I know that other languages (eg. Python) have ** operator bind tighter than negation, but seeing -1 ** 0.5 give the result -1 and having to type parenthesis (-1) ** 0.5... Even if it's not worth changing, I'd like to hear this rationalized. I've asked about rationalization of this on SO, and nobody seems to know why this precedence is the way it is. -- http://bugs.ruby-lang.org/