help-octave
[Top][All Lists]
Advanced

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

Re: 'iscomplex' not a useful function


From: James Sherman Jr.
Subject: Re: 'iscomplex' not a useful function
Date: Tue, 19 Oct 2010 20:40:28 -0400

On Tue, Oct 19, 2010 at 7:01 PM, Muhali <address@hidden> wrote:

The intended behavior of the 'iscomplex' function is to indicate whether a
number has a nonzero imaginary part. This is a useful functionality, but it
is covered by the function 'isreal'. Since the complex numbers form a
superset of the reals, and octave does not seem to be using any numbers
other than these, I suggest to drop the 'iscomplex' function completely.

Muhali


I'd say there are three problems with this suggestion:

1) iscomplex is not the negation of isreal if the argument is not numeric.  I believe that it is essentially:
iscomplex(x) = isnumeric(x)&~isreal(x)

2) Even if it was just the negation, I think its "nicer" in code to read "if iscomplex(x)" than "if ~isreal(x)" so I'd argue that there is some aesthetic value to keeping it.

3) Again even if it was just a negation, the function straightforward and intuitive (it returns exactly what the function name implies) and it isn't like it is taking up a lot of space.  I don't see any net benefit to removing it.

Just my 2 cents.

reply via email to

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