Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: i <= 0 ??
Date: Fri, 30 Oct 2009 21:15:20 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 19
Message-ID: <hcfl17$2ja$1@fred.mathworks.com>
References: <hcfjrm$jcs$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1256937320 2666 172.30.248.35 (30 Oct 2009 21:15:20 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 30 Oct 2009 21:15:20 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:581414


From the doc:

[... The operators <, >, <=, and >= use only the real part of their operands for the comparison. The operators == and ~= test real and imaginary parts. ..]

And to confuse even more, SORT uses another relation ordering (I believe the *magnitude* is compared)

>> sort([1+1i 2i])

ans =

   1.0000 + 1.0000i        0 + 2.0000i

>> 1+1i<=2i

ans =

     0

% Bruno