bugGNU Octave - Bugs: bug #29685, Using abs() on a int16 or int8...

 
 

bug #29685: Using abs() on a int16 or int8 vector changes the vector

Submitted by:  Wim van der Meer <wim_octave>
Submitted on:  Tue 27 Apr 2010 02:39:48 AM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: John W. Eaton <jwe>
Originator Name: WimOpen/Closed: Closed
Release: 3.2.2Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 27 Apr 2010 04:55:25 AM UTC, comment #2:

Given the definition of abs in liboctave/intNDArray.cc, I would expect this problem to affect all integer types. The same problem is also present for the sign function (signum in the intNDArray class). I checked in the following change:

http://hg.savannah.gnu.org/hgweb/octave/rev/87f879cf48fd

John W. Eaton <jwe>
Project AdministratorIn charge of this item.
Tue 27 Apr 2010 04:15:43 AM UTC, comment #1:

This is confirmed with a very recent development tip (10576). Interestingly, it does seem to only affect int8 and int16. The class int32 works as expected.

Rik <rik5>
Project Administrator
Tue 27 Apr 2010 02:39:48 AM UTC, original submission:

octave:53> a = int8([-6 -3])
a =

-6 -3

octave:54> abs(a)
ans =

6 3

octave:55> a
a =

6 3

I would expect the abs operator to not change the original data!

Wim van der Meer <wim_octave>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by wim_octave (Submitted the item)
  • -unavailable- added by wim_octave
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

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

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 27 Apr 2010 04:55:25 AM UTCjweStatusConfirmed=>Fixed
      Assigned toNone=>jwe
      Open/ClosedOpen=>Closed
    Tue 27 Apr 2010 04:15:43 AM UTCrik5StatusNone=>Confirmed
    Tue 27 Apr 2010 02:39:48 AM UTCwim_octaveCarbon-Copy-=>Added wim_octave

    Back to the top


    Powered by Savane 3.1-cleanup1