octave-maintainers
[Top][All Lists]
Advanced

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

Re: [Changeset] isa function with float and numeric arguments


From: Bill Denney
Subject: Re: [Changeset] isa function with float and numeric arguments
Date: Mon, 12 May 2008 18:53:54 -0400
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)

David Bateman wrote:
David Bateman wrote:
The isa function should allow the "float" and "numeric" arguments. The
attached patch adds this.

D.
Please use this version instead.

D.
Wouldn't this be easier to read (and marginally faster) if written as:

if (strcmp (cname, "float"))
 retval = any (strcmp (class (x), {"double" "single"}));
elseif (strcmp (cname, "fnumeric"))
 classes = {"double" "single" "uint8" "uint16" "uint32" "uint64" "int8" "int16" "int32" 
"int64"};
 retval = any (strcmp (class (x), classes));
else
 retval = strcmp (class (x), cname);
endif


Have a good day,

Bill


reply via email to

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