octave-maintainers
[Top][All Lists]
Advanced

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

Re: a < b incorrect for complex numbers on MinGW


From: Jordi Gutiérrez Hermoso
Subject: Re: a < b incorrect for complex numbers on MinGW
Date: Tue, 12 Nov 2013 21:24:36 -0500

On Tue, 2013-11-12 at 17:57 -0800, Ed Meyer wrote:
> since ordering relations don't make sense for complex numbers it
> seems like this should yield a warning. a < b should not even
> compile - there shouldn't be an operator< for complex

Well,

    For complex numbers, the following ordering is defined: z1 < z2 iff

           abs(z1) < abs(z2)
           || (abs(z1) == abs(z2) && arg(z1) < arg(z2))

    This is consistent with the ordering used by max, min and sort,
    but is not consistent with matlab, which only compares the real
    parts.

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

I don't recall anyone ever complaining about this not being
Matlab-compatible, though.

- Jordi G. H.





reply via email to

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