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


bug #53011: Documentation of sort and comparison operators

Submitted by:  Michael Leitner <mleitner>
Submitted on:  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

Add a New Comment (Rich Markup)

You are not logged in

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


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])

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:


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:

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)

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

    Only project 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.7