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

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

[Octave-bug-tracker] [bug #47468] ones() is able to create array with nu


From: Carnë Draug
Subject: [Octave-bug-tracker] [bug #47468] ones() is able to create array with number of elements above sizemax
Date: Sat, 19 Mar 2016 19:37:41 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.6.1

Follow-up Comment #1, bug #47468 (project octave):

Actually, I am probably on the border of my available memory so the error
comes from there instead of input checking (for the case of zeros).

But the original issue remains that 'ones (1, sizemax ()+1)' is doing
something odd (now that I think about it is also returning too quickly). It
behaves as expected when I specify its type:


octave> uint64 (numel (ones (1, sizemax (), "uint8")))
ans = 2147483646
octave> uint64 (numel (ones (1, sizemax () +1, "uint8")))
error: out of memory or dimension too large for Octave's index type
octave> uint64 (numel (ones (sizemax (), 1, "uint8")))
ans = 2147483646
octave> uint64 (numel (ones (1, 1, sizemax (), "uint8")))
ans = 2147483646
octave> uint64 (numel (zeros (sizemax (), 1, "uint8")))
ans = 2147483646


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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