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: John W. Eaton
Subject: Re: 'iscomplex' not a useful function
Date: Tue, 19 Oct 2010 22:00:44 -0400

On 19-Oct-2010, Muhali wrote:

| James Sherman Jr.-2 wrote:
| > 
| > 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)
| > 
| 
| My point is different. A functionionality as described in 1) should not be
| named 'iscomplex', as from a mathematical viewpoint, e.g. 0, 1, pi, or i
| (the imaginary unit) are all complex numbers. A name like 'isimag' would be
| more correct and less misleading.

You are missing the point of the iscomplex function.  It returns true
if its argument is stored internally using a complex data type.  It's
not about the value of the object.  For example:

  octave:1> x = complex (1, 0)
  x =  1 + 0i
  octave:2> iscomplex (x)
  ans =  1
  octave:3> iscomplex (1)
  ans = 0
  octave:4> iscomplex ("")
  ans = 0

Perhaps this function is not useful for you.  If so, then I guess you
don't have to use it.

jwe


reply via email to

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