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

Add a New Comment Rich Markup

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


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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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

    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.


    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code