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

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

[Octave-bug-tracker] [bug #50924] Different result between range operati


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #50924] Different result between range operation and vector operation
Date: Wed, 3 May 2017 10:53:02 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

Update of bug #50924 (project octave):

                Priority:              5 - Normal => 3 - Low                
              Item Group:        Incorrect Result => Inaccurate Result      
                  Status:                    None => Confirmed              

    _______________________________________________________

Follow-up Comment #1:

The difference happens because multiplying a range object by a scalar changes
the base, limit, and increment values, and then the elements (when needed) are
computed using those new values.  It's as if you wrote


step:step:(n*step)


instead.  In the vector case, the values are computed by multiplying STEP by
each integer in the range 1:n.

I agree that they should return the same result if possible.  OTOH, the range
operator in Octave is a space optimization and the difference is less than
eps.

You can completely disable Octave's special range type using


disable_range (true);


Maybe we should also have another setting that forces a range to vector
conversion whenever an operation other than indexing is performed on a range
object, and that operation would result in the endpoints or step no longer
being integers?

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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