[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #33304] power operator precedence and directio
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #33304] power operator precedence and direction |
Date: |
Sun, 15 May 2011 00:54:24 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 |
Update of bug #33304 (project octave):
Status: None => Confirmed
_______________________________________________________
Follow-up Comment #1:
This issue is confirmed on the development branch, even with the changes to
operator precedence made in changset 002948ae5bc0.
It would be useful if someone with access to Matlab could verify how it
handles the situation. The operator precedence levels are defined here
(http://www.mathworks.com/help/techdoc/matlab_prog/f0-40063.html#f0-38155) and
they have exponent above unary minus and all operators at the same precedence
level acting left-to-right.
Sample code to verify operation:
2^-4^3 = ???
In octave, this is parsed as
2^(-4^3) == 2^(-64) = 5.4210e-20
I agree that I would expect the behavior to be parsed as
(2^-4)^3 == .0625^3 = 2.4414e-04
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?33304>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/