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

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

[Octave-bug-tracker] [bug #50238] sum, cumsum, etc. mishandle integer in


From: Guillaume
Subject: [Octave-bug-tracker] [bug #50238] sum, cumsum, etc. mishandle integer inputs
Date: Mon, 6 Feb 2017 16:14:01 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0

Follow-up Comment #2, bug #50238 (project octave):

The issue indeed seems to be with cumsum: by default, Octave performs the
operation as double while Matlab uses the same class as the input and does not
provide a mechanism to change this behavior:

++
>> a = uint8([150 150]);
>> sum(a)

ans =

   300

>> sum(a,'native')

ans =

  uint8

   255

>> cumsum(a)

ans =

  1×2 uint8 row vector

   150   255

>> cumsum(a,'native')
Error using cumsum
Invalid option. Option must be 'forward', 'reverse', 'omitnan' or
'includenan'.
--

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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