Mercurial > hg > octave-terminal
changeset 4524:fd95dc5e6f28
[project @ 2003-10-02 03:14:48 by jwe]
author | jwe |
---|---|
date | Thu, 02 Oct 2003 03:14:48 +0000 |
parents | 19aaeabe269a |
children | cccd107fa208 |
files | doc/interpreter/preface.txi src/ChangeLog src/mappers.cc |
diffstat | 3 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/interpreter/preface.txi +++ b/doc/interpreter/preface.txi @@ -171,7 +171,7 @@ to @code{dlqe} and @code{dlqr}. @item -Tony Richardson @email{arichard@@stark.cc.oh.us} wrote Octave's +Tony Richardson @email{richardson@@evansville.edu?} wrote Octave's image processing functions as well as most of the original polynomial functions.
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2003-10-01 John W. Eaton <jwe@bevo.che.wisc.edu> + + * mappers.cc (xabs): New function. + (install_mapper_functions): Use it instead of abs for complex args + in Octave's abs mapper function. + 2003-09-27 Joseph P. Skudlarek <Jskud@Jskud.com> * DLD-FUNCTIONS/minmax.cc (min, max): Use @deftypefn machinery,
--- a/src/mappers.cc +++ b/src/mappers.cc @@ -27,6 +27,7 @@ #include <cctype> #include <cfloat> +#include "lo-ieee.h" #include "lo-specfun.h" #include "lo-mappers.h" @@ -134,6 +135,12 @@ return toupper (c); } +static double +xabs (const Complex& x) +{ + return (xisinf (x.real ()) || xisinf (x.imag ())) ? octave_Inf : abs (x); +} + static Complex xconj (const Complex& x) { @@ -161,7 +168,7 @@ void install_mapper_functions (void) { - DEFUN_MAPPER (abs, xabs, 0, 0, fabs, abs, 0, 0.0, 0.0, 1, 0, + DEFUN_MAPPER (abs, xabs, 0, 0, fabs, xabs, 0, 0.0, 0.0, 1, 0, "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} abs (@var{z})\n\ Compute the magnitude of @var{z}, defined as\n\