bugGNU Octave - Bugs: bug #42301, '<' should be transitive for...

 
 

bug #42301: '<' should be transitive for complex values

Submitter:  David Spies <dspyz>
Submitted:  Mon 05 May 2014 09:56:46 PM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Wont Fix Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 05 May 2014 10:11:32 PM UTC, comment #1: 

See https://www.gnu.org/software/octave/doc/interpreter/Comparison-Ops.html

You are right that it is not transitive, when comparing a mix of complex and real types. When all types are complex (== have non-zero imaginary parts), it should be transitive. And you're also right that it is not Matlab compatible.

See also the recent discussion at http://octave.1599824.n4.nabble.com/a-b-incorrect-for-complex-numbers-on-MinGW-tp4659102p4659104.html

Mike Miller <mtmiller>
Group Member
Mon 05 May 2014 09:56:46 PM UTC, original submission:  

I can't figure out what rule octave uses to determine ordering among complex values, but it's clearly not transitive

octave:19> 3i < -4
ans =  1
octave:20> -4 < 0
ans =  1
octave:21> 3i < 0
ans = 0

In Matlab, it throws out the imaginary part and just compares the real part:

 

>> 2 < i


ans =

     0

>> i < 2


ans =

     1

>> i < 0


ans =

     0

>> 0 < i


ans =

     0



David Spies <dspyz>

 

(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 rik5 (Updated the item)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by dspyz (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-01-26 rik5 StatusNeed Info Wont Fix
        Open/ClosedOpen Closed
    2014-05-05 mtmiller CategoryOctave Function Libraries
        StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-aa77.
    Corresponding source code