Issue #7331 has been updated by stomar (Marcus Stollsteimer).


=begin
This has no relevance to the issue, but I think your point of view is wrong. :-)
You should do it the "mathematical" way not only for people with mathematical background but even more so for "normal" people.

My common sense as a teacher leads me to believe that a "normal" person would tend to just take a formula from a textbook, e. g. to calculate compound interest or whatever, without ever thinking about subleties like operator precedence.
A mathematician is much more likely to make sure what the exact precedence rules in the used programming language are, or to use parentheses just to make sure, and he would also have less difficulty in adapting to a different set of rules.

I observe a related phenomena with students that happily calculate the volume of a sphere with (({4 / 3 * Math::PI * radius**3})), not thinking about subleties like integer division.

So, stay as close to the mathematical rules as possible. (And not primarily for the mathematician's sake!)
=end

----------------------------------------
Bug #7331: Set the precedence of unary `-` equal to the precedence `-`, same for `+`
https://bugs.ruby-lang.org/issues/7331#change-33390

Author: alexeymuranov (Alexey Muranov)
Status: Rejected
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: 1.9.3


=begin
I will not be surprised if this proposal is rejected, because the compatibility would be a mess, but i feel i need to start a discussion.  This continues the discussion in #7328.

To the best of my knowledge, in mathematics the unary minus has the same precedence as the binary one.  However, in the expression

  - a * b

Ruby computes first (({-a})), and then the product.  This means that if i want (for whatever reason) to compute the expression in the natural order, i have to put the parentheses:

  - (a * b)

which looks very strange to me.  I would consider this a bug.
=end



-- 
http://bugs.ruby-lang.org/