[SciPy-user] numarray complex comparisons
Stephen Walton
stephen.walton at csun.edu
Tue Dec 10 15:53:31 EST 2002
I'm guessing that the lack of screams here means most people are OK with
Perry's decision to have complex comparisons generate exceptions? It is
fine by me. FWIW, I just did a little experiment in Fortran,. The
Absoft Linux compiler (version 4.6) considers (a .lt. b) to be
equivalent to (real(a) .lt. real(b)). g77 throws a compile time
exception on the same code. So I doubt there is any legacy code which
does anything useful with complex compares and Perry's idea is fine.
Steve
On Mon, 2002-12-09 at 07:37, Perry Greenfield wrote:
> The questions just keep coming...
>
> We need to decide whether or not complex comparisons work.
> They do not work for Python scalars. Consistency would argue
> for them not working for numarray arrays. However some argue:
>
> 1) not allowing them defeats more generic programming. We agreed
> until we found that IDL doesn't support them either, and we never
> noticed. We are skeptical of this claim and would like to see
> real-life examples.
>
> 2) it is useful to allow comparisons since that would result in
> repeatable, sorting of values (e.g., to find duplicate values)
> for ordering purposes. Cannot this just be handled by the sort
> routines themselves? Why must this result in comparison operators
> working?
>
> In the absence of good examples for 1) or good arguments for 2)
> we propose to make complex comparisons generate exceptions.
>
> Perry Greenfield
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user
--
Stephen Walton, Professor, Dept. of Physics & Astronomy, Cal State
Northridge
stephen.walton at csun.edu
More information about the SciPy-User
mailing list