|
| From: | anonymous |
| Subject: | [Octave-bug-tracker] [bug #54491] Order of evaluation of power with unitary operators |
| Date: | Sat, 11 Aug 2018 15:10:22 -0400 (EDT) |
| User-agent: | Mozilla/5.0 (Windows NT 5.1; rv:51.0) Gecko/20100101 Firefox/51.0 |
Follow-up Comment #2, bug #54491 (project octave):
function out = test()
global a;
a = 2;
end
global a;
a = 1;
z=[7 8]
z(a) ^=- test();
I don't have MATLAB but it should work:
function out = test()
global a;
a = 2;
end
global a;
a = 1;
z=[7 8]
z(a) ^- test();
a
Evaluation order from the left to right prints 2 the order from the right to
left it prints 1.
I think precedence, associativity and order of evaluation should be exactly
defined so a programmer using that rules knows how to program with the
programming language.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?54491>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
| [Prev in Thread] | Current Thread | [Next in Thread] |