Mercurial > hg > octave-nkf
changeset 3186:edaa9a2d3d9c
[project @ 1998-10-02 19:12:19 by jwe]
author | jwe |
---|---|
date | Fri, 02 Oct 1998 19:12:19 +0000 |
parents | 9580887dd160 |
children | 3d3eca53ecca |
files | src/data.cc |
diffstat | 1 files changed, 16 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/data.cc +++ b/src/data.cc @@ -730,22 +730,26 @@ return retval; } +DEFUN (is_complex, args, , + "is_complex (x): return nonzero if x is a complex numeric object") +{ + octave_value retval; + + if (args.length () == 1) + retval = args(0).is_complex_type () ? 1.0 : 0.0; + else + print_usage ("is_complex"); + + return retval; +} + DEFUN (is_struct, args, , "is_struct (x): return nonzero if x is a structure") { - octave_value_list retval; - - int nargin = args.length (); + octave_value retval; - if (nargin == 1) - { - octave_value arg = args(0); - - if (arg.is_map ()) - retval = 1.0; - else - retval = 0.0; - } + if (args.length () == 1) + retval = args(0).is_map () ? 1.0 : 0.0; else print_usage ("is_struct");