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

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

[Octave-bug-tracker] [bug #57166] ones(), zeros(), pi(), e() do not thro


From: Rik
Subject: [Octave-bug-tracker] [bug #57166] ones(), zeros(), pi(), e() do not throw error when asked to create an array larger than is possible
Date: Mon, 4 Nov 2019 11:31:09 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

URL:
  <https://savannah.gnu.org/bugs/?57166>

                 Summary: ones(), zeros(), pi(), e() do not throw error when
asked to create an array larger than is possible
                 Project: GNU Octave
            Submitted by: rik5
            Submitted on: Mon 04 Nov 2019 08:31:07 AM PST
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Missed Error or Warning
                  Status: Confirmed
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

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.





    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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