bugGNU Octave - Bugs: bug #44291, nextpow2 with vector uses length...

 
 

bug #44291: nextpow2 with vector uses length of vector instead of each element of vector

Submitter:  Carnë Draug <carandraug>
Submitted:  Wed 18 Feb 2015 04:53:39 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  carandraug
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 20 Feb 2015 10:33:25 AM UTC, comment #2: 
Carnë Draug <carandraug>
Group Member
Wed 18 Feb 2015 05:38:30 PM UTC, comment #1: 

Attached proposed fix. I could not find any nextpow2 usage in core where an input vector was being used. No failures on make check after the change.

Will push it in a few days if no one opposes.

(file #33115)

Carnë Draug <carandraug>
Group Member
Wed 18 Feb 2015 04:53:39 PM UTC, original submission:  

When calling nextpow2 with a vector, Octave currently uses the length of the vector. On the other hand, Matlab computes the nextpow2 for each element of the vector.


octave-cli-3.8.2> nextpow2 ([15])
ans =  4
octave-cli-3.8.2> nextpow2 ([15 15])  # is computing nextpow2 (length ([15 15]))
ans =  1


I can fix this myself, but that is a backwards incompatible change (also, I believe that Matlab behaviour here is saner but I am more used to nd signals).

Carnë Draug <carandraug>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #33115:  bug44291-fix.cset added by carandraug (3KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by carandraug (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.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-02-20 carandraug StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2015-02-18 carandraug StatusNone Patch Submitted
        Assigned toNone carandraug
    2015-02-18 carandraug Attached File- Added bug44291-fix.cset, #33115

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code