octave-maintainers
[Top][All Lists]
Advanced

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

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


From: John W. Eaton
Subject: [PATCH] Add min/max tests. (4/4)
Date: Mon, 4 Sep 2000 07:24:12 -0500 (CDT)

On  3-Sep-2000, Edward Jason Riedy <address@hidden> wrote:

| This adds a bunch of regression test cases for the previous code.
| It also adds one more that checks that the same comparison is used
| throughout a complex matrix.  Previously, Octave would magically
| revert back to the real comparison (directed rather than magnitude)
| if a column contained only real numbers.  That's surprising.

I think that

  octave:4> x = [1+i, -2; -1+i, 1]
  x =

     1 + 1i  -2 + 0i
    -1 + 1i   1 + 0i

  octave:5> min(x)
  ans =

    -1 + 1i  -2 + 0i

is much less surprising than

  octave:5> min(x)
  ans =

    -1 + 1i   1 + 0i

since -2 is smaller than 1 but I can also see the case for not
applying special cases like this.  (Instead, Octave should perform
data type conversions when appropriate so that the special cases are
not necessary, but that's not possible here since matrices can only be
real or complex, not both.)

How hard would it be to allow either behavior (given an option to min/max)?

jwe



reply via email to

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