|
From: | anonymous |
Subject: | [Octave-bug-tracker] [bug #33304] power operator precedence and direction |
Date: | Fri, 13 May 2011 09:26:33 +0000 |
User-agent: | Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; pl-pl) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27 |
URL: <http://savannah.gnu.org/bugs/?33304> Summary: power operator precedence and direction Project: GNU Octave Submitted by: None Submitted on: Fri May 13 09:26:32 2011 Category: Interpreter Severity: 3 - Normal Priority: 5 - Normal Item Group: Incorrect Result Status: None Assigned to: None Originator Name: pawel Originator Email: address@hidden Open/Closed: Open Discussion Lock: Any Release: 3.4.0 Operating System: Mac OS _______________________________________________________ Details: expression > a^b^c is evaluated from left to right as > (a^b)^c which is eqaul and could or even should be equivalent of > a^(b*c) however expression > -a^-b^-c is evaluated from right to left > -a^(-b^-c) which is not equal > -a^(-b*(-c)) i think it's serious inconsistency. The case could be simpler if unary operator had higher priority then power, hovewer i agree that -x^y = -(x^y). I think that parser should follow semantic like: unaryExpr: (+|-|!)? powerExpr; powerExpr: atom (^ exp)*; exp : (+|-|!)? atom; atom: ID | NUMBER | FUNCTION_CALL | ( expression ) _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?33304> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |