octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #51962] "A++" assigns to 'ans' while "A += 1"


From: Rik
Subject: [Octave-bug-tracker] [bug #51962] "A++" assigns to 'ans' while "A += 1" and "A = A + 1" do not
Date: Fri, 8 Sep 2017 13:40:31 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Update of bug #51962 (project octave):

                 Summary: ++ and -- not same as +1 and -1 => "A++" assigns to
'ans' while "A += 1" and "A = A + 1" do not

    _______________________________________________________

Follow-up Comment #3:

I re-titled the bug report, but yes, this is ordinary and expected Octave
behavior.  Whenever you execute an operation, for which no variable is
assigned, then the default variable 'ans' gets the output.

The easy workaround, as mentioned, is to use assignment so that 'ans' is not
created.  Alternatively, you could look at using a different algorithm that
doesn't use so much memory.  If your matrices are large, but mostly 0
elements, then use sparse arrays.  And as a last resort, just run on a machine
with more memory.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51962>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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