bugGNU Octave - Bugs: bug #57166, ones(), zeros(), pi(), e() do not...

 
 

bug #57166: ones(), zeros(), pi(), e() do not throw error when asked to create an array larger than is possible

Submitter:  Rik <rik5>
Submitted:  Mon 04 Nov 2019 04:31:07 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Missed Error or Warning
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Mon 04 Nov 2019 04:31:07 PM UTC, original submission:  

This is easiest to see if Octave has been configured with --disable-64 so that the octave_idx_type is an int32.  In that case, the largest number of elements for any dimension is intmax ("int32").  Below is an example


octave:4> format long
octave:5> N = double (intmax ("int32"))
N = 2147483647
octave:6> N = N + 100
N = 2147483747
octave:7> x = ones (N, 1, "uint8");
octave:8> numel (x)
ans = 2147483647
octave:9> diary off


The interpreter truncated the number of elements to the maximum possible, but there was no warning about that.  Bug #47468 is related, but different.

Rik <rik5>
Group administrator

 

Attached Files

This item currently has no attached files.

(Note: upload size limit is set to 4.0MiB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by rik5 (Submitted the item)
  •  

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

    History

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.16-598c.
    Corresponding source code