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

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

[Octave-bug-tracker] [bug #65423] Sort order is wrong for real numbers


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #65423] Sort order is wrong for real numbers
Date: Wed, 6 Mar 2024 13:16:51 -0500 (EST)

Update of bug #65423 (group octave):

                  Status:                    None => Invalid                
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #1:

octave's output is currently matlab compatible and performing as expected. 
note that sorting complex numbers involves some arbitrary choices, as there is
no 'correct' definition for what takes precedence.  The method currently used
by Octave and (by default) in Matlab is 

"Sorting of complex entries is done first by magnitude (‘abs (Z)’) and for
any ties by phase angle (‘angle (z)’)."


>> abs(B)
ans =

   1.0000   1.0000   1.0000
   1.0000   1.0000   1.0000
   1.0000   1.0000   1.0000
   1.0000   1.4142   1.4142
   1.0000   1.0000   1.0000
   1.0000   1.0000   1.0000
   1.0000   1.0000   1.0000
   1.0000   1.4142   1.4142

>> angle(B)
ans =

  -1.5708        0   1.5708
  -1.5708   1.5708   3.1416
        0        0        0
        0  -2.3562   2.3562
        0        0   3.1416
        0   3.1416   3.1416
   3.1416   3.1416   3.1416
   3.1416  -0.7854   0.7854



closing report.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65423>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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