octave-maintainers
[Top][All Lists]
Advanced

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

Re: [PATCH] Add min/max tests. (4/4)


From: John W. Eaton
Subject: Re: [PATCH] Add min/max tests. (4/4)
Date: Wed, 6 Sep 2000 14:58:32 -0500 (CDT)

On  5-Sep-2000, I wrote

| How about
| 
|   min (abs (x), abs (y))
| 
| ?

as a suggestion for how to explicitly state that you want to find the
numbers with the minimum magnitudes.  After sending it, I realized
that this is not really what you want, since it returns the minimum
magnitudes, not the NUMBERS with the minimum magnitudes.  So, I think
what is really needed is some way to tell the min and max funtions
what comparison operation (or function) to use.  That would allow the
programmer to clearly state his intention instead of relying on some
convention that can cause trouble when there are mixed types or the
potential for automatic data type conversions to occur.

Also, if it were up to me (or if I could do it over again) I would
want to avoid the problem that results from min, max, and other
functions working on columns of a matrix except when the matrix
happens to have only one row.

jwe



reply via email to

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