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

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

[Octave-bug-tracker] [bug #61788] arrays of type int16 contain wrong num


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #61788] arrays of type int16 contain wrong numbers
Date: Tue, 11 Jan 2022 10:36:58 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0

Follow-up Comment #7, bug #61788 (project octave):

Yes, you can see from the output of whos that x = 1:10 or y = (1:10) is
different from z = [1:10]:


octave:1> x = 1:10; y = (1:10); z = [1:10]; whos
Variables visible from the current scope:

variables in scope: top scope

  Attr   Name        Size                     Bytes  Class
  ====   ====        ====                     =====  ===== 
         x           1x10                        24  double
         y           1x10                        24  double
         z           1x10                        80  double

Total is 30 elements using 128 bytes
-verbatim+

Note that I would only propose changing the way that elements of arrays are
computed from range expressions for integer ranges.  I don't think it is
appropriate to repeatedly add the increment for floating point ranges.

I have proposed eliminating special data types (range, permutation matrix, and
diagonal matrix) in the past but have met resistance because it will cause
some operations to consume much more memory.  OTOH, it will improve
compatibility and reduce maintenance issues.  I'm even more convinced now that
these storage optimizations are not worth the effort.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61788>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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