Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
None
-
None
-
None
-
None
Description
Currently the precedence order is:
level 1: post inc/dec level 2: power level 3: pre inc/dec
The original intention, I believe, was always:
level 1: post inc/dec level 2: pre inc/dec level 3: power
This leads to some unintuitive behavior:
while these are the same:
println (-9 + 2) // -7 println ((-9) + 2) // -7
these are different:
println (-9 ** 2) // -81 actually: println (-(9 ** 2)) println ((-9) ** 2) // 81
Similar anomalies occur between ** and ++/--