octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: undefined compound chaining behavior


From: Ben Abbott
Subject: Re: undefined compound chaining behavior
Date: Tue, 10 Jun 2014 07:16:11 -0400

On Jun 10, 2014, at 12:39 AM, Hossein Sajjadi <address@hidden> wrote:

> accoring to the manual:
> expr1 op= expr2
> is evaluated as
> expr1 = (expr1) op (expr2)
> 
> so the expression
> a=1;
> a+=(a+=4);
> 
> should be equivalent to
> a=1;
> a=a+(a=a+4);
> 
> but the firt expression results 10  and second results 6

Both evaluate to 10 for me.

a=1;a+=(a+=4)
a =  10
a=1;a+=(a=a+4)
a =  10

Ben



reply via email to

[Prev in Thread] Current Thread [Next in Thread]