# HG changeset patch # User jwe # Date 1142363621 0 # Node ID d42bd103de79f30fc2828bf34be80a363449fdad # Parent f043021a9df7495fcda273d0c0ae26569ffb44b6 [project @ 2006-03-14 19:13:40 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2006-03-14 Bill Denney + + * load-save.cc (Fload, Fsave): Update docstring for functional form. + +2006-03-14 John W. Eaton + + * xpow.cc (elem_xpow): Undo previous change. + 2006-03-14 Paul Kienzle * xpow.cc: New tests. diff --git a/src/load-save.cc b/src/load-save.cc --- a/src/load-save.cc +++ b/src/load-save.cc @@ -600,6 +600,16 @@ load data\n\ @end example\n\ \n\ +If load is invoked using the functional form\n\ +\n\ +@example\n\ +load (\"-text\", \"file.txt\", \"a\")\n\ +@end example\n\ +\n\ +@noindent\n\ +then the @var{options}, @var{file}, and variable name arguments\n\ +(@var{v1}, @dots{}) must be specified as character strings.\n\ +\n\ If a variable that is not marked as global is loaded from a file when a\n\ global symbol with the same name already exists, it is loaded in the\n\ global symbol table. Also, if a variable is marked as global in a file\n\ @@ -1447,7 +1457,7 @@ DEFCMD (save, args, , "-*- texinfo -*-\n\ -@deffn {Command} save options file v1 v2 @dots{}\n\ +@deffn {Command} save options file @var{v1} @var{v2} @dots{}\n\ Save the named variables @var{v1}, @var{v2}, @dots{} in the file\n\ @var{file}. The special filename @samp{-} can be used to write the\n\ output to your terminal. If no variable names are listed, Octave saves\n\ @@ -1456,6 +1466,16 @@ modify the output format override the format specified by the built-in\n\ variable @code{default_save_options}.\n\ \n\ +If save is invoked using the functional form\n\ +\n\ +@example\n\ +save (\"-text\", \"file.txt\", \"a\")\n\ +@end example\n\ +\n\ +@noindent\n\ +then the @var{options}, @var{file}, and variable name arguments\n\ +(@var{vname1}, @dots{}) must be specified as character strings.\n\ +\n\ @table @code\n\ @item -ascii\n\ Save the data in Octave's text data format.\n\ diff --git a/src/xpow.cc b/src/xpow.cc --- a/src/xpow.cc +++ b/src/xpow.cc @@ -569,15 +569,11 @@ for (octave_idx_type j = 0; j < nc; j++) for (octave_idx_type i = 0; i < nr; i++) { - OCTAVE_QUIT; - double ax = a (i, j); - if (ax < 0.0) - { - Complex atmp (ax); - result (i, j) = std::pow (atmp, b); - } - else - result (i, j) = std::pow (ax, b); + OCTAVE_QUIT; + + Complex atmp (a (i, j)); + + result (i, j) = std::pow (atmp, b); } retval = result; @@ -641,16 +637,9 @@ for (octave_idx_type i = 0; i < nr; i++) { OCTAVE_QUIT; - double ax = a (i, j); - double bx = b (i, j); - if (ax < 0.0 && static_cast (bx) != bx) - { - Complex atmp (ax); - Complex btmp (bx); - complex_result (i, j) = std::pow (atmp, btmp); - } - else - complex_result (i, j) = std::pow (ax, bx); + Complex atmp (a (i, j)); + Complex btmp (b (i, j)); + complex_result (i, j) = std::pow (atmp, btmp); } retval = complex_result; @@ -964,14 +953,10 @@ for (octave_idx_type i = 0; i < a.length (); i++) { OCTAVE_QUIT; - double ax = a (i); - if (ax < 0.0) - { - Complex atmp (ax); - result(i) = std::pow (atmp, b); - } - else - result(i) = std::pow (ax, b); + + Complex atmp (a (i)); + + result(i) = std::pow (atmp, b); } retval = result; @@ -1032,16 +1017,9 @@ for (octave_idx_type i = 0; i < len; i++) { OCTAVE_QUIT; - double ax = a(i); - double bx = b(i); - if (ax < 0.0 && static_cast (bx) != bx) - { - Complex atmp (ax); - Complex btmp (bx); - complex_result(i) = std::pow (atmp, btmp); - } - else - complex_result(i) = std::pow (ax, bx); + Complex atmp (a(i)); + Complex btmp (b(i)); + complex_result(i) = std::pow (atmp, btmp); } retval = complex_result;