bugGNU Octave - Bugs: bug #53011, Documentation of sort and...

 
 

bug #53011: Documentation of sort and comparison operators

Submitter:  Michael Leitner <mleitner>
Submitted:  Tue 30 Jan 2018 10:22:07 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Documentation
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * 4.2.1 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 30 Jan 2018 10:22:07 AM UTC, original submission:  

I am splitting up bug #52919. First the smallest issue, that I called a buglet there:

According to the documentation of sort: Sorting of complex entries is done first by magnitude ('abs (Z)') and for any ties by phase angle ('angle (z)'). However, consider the following code:


a=complex([-5; 0; 5;0;-5],[+0;5; 0;-5;-0])
abs(a)==5
angle(a)
angle(sort(a))


That is, all entries have the same length and thus should be sorted according to angle. But they are not due to inconsistent treating of +0i and -0i on the negative axis. This is due to the comparison on complex values:


a<=5


As Rik noted in comment 14 of #52919, if in the comparison an angle of -pi appears, it is mapped to +pi. So this is a documentation bug for sort and the comparison operators, of course only of low priority.

Michael Leitner <mleitner>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-02-02 amro_octave Carbon-Copy- Added amro_octave

    Back to the top

    Powered by Savane 3.13-8ccc.
    Corresponding source code