# HG changeset patch # User Rik # Date 1244350870 25200 # Node ID fb8b8589dd467e3021e9686b33f038e6f2541696 # Parent f2bf62f6228692a98b52bd0c455d7d7d9a836355 Expand documentation for 'complex' function diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2009-06-06 Rik + + * data.cc: Update documentation for 'complex' function + 2009-06-06 Rik * load-save.cc: Update documentation for NA and isna functions diff --git a/src/data.cc b/src/data.cc --- a/src/data.cc +++ b/src/data.cc @@ -2783,9 +2783,20 @@ DEFUN (complex, args, , "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} complex (@var{val})\n\ +@deftypefn {Built-in Function} {} complex (@var{x})\n\ @deftypefnx {Built-in Function} {} complex (@var{re}, @var{im})\n\ -Convert @var{x} to a complex value.\n\ +Return a complex result from real arguments. With 1 real argument @var{x},\n\ +return the complex result @code{@var{x} + 0i}. With 2 real arguments,\n\ +return the complex result @code{@var{re} + @var{im}}. @code{complex} can\n\ +often be more convenient than expressions such as @code{a + i*b}.\n\ +For example:\n\ +\n\ +@example\n\ +complex ([1, 2], [3, 4])\n\ +@result{}\n\ + 1 + 3i 2 + 4i\n\ +@end example\n\ +@seealso{real, imag, iscomplex}\n\ @end deftypefn") { octave_value retval; diff --git a/src/ov-flt-re-mat.cc b/src/ov-flt-re-mat.cc --- a/src/ov-flt-re-mat.cc +++ b/src/ov-flt-re-mat.cc @@ -816,6 +816,7 @@ "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} single (@var{x})\n\ Convert @var{x} to single precision type.\n\ +@seealso{double}\n\ @end deftypefn") { // The OCTAVE_TYPE_CONV_BODY3 macro declares retval, so they go diff --git a/src/ov-re-mat.cc b/src/ov-re-mat.cc --- a/src/ov-re-mat.cc +++ b/src/ov-re-mat.cc @@ -844,6 +844,7 @@ "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} double (@var{x})\n\ Convert @var{x} to double precision type.\n\ +@seealso{single}\n\ @end deftypefn") { // The OCTAVE_TYPE_CONV_BODY3 macro declares retval, so they go