changeset 9141:c1fff751b5a8

Update section 17.1 (Utility Functions) of arith.txi Split section into "Exponents and Logarithms" and "Utility Functions" Use Tex in many more of the doc strings for pretty printing in pdf format.
author Rik <rdrider0-list@yahoo.com>
date Mon, 20 Apr 2009 17:16:09 -0700
parents c309e028185e
children b38c45d1fc08
files doc/ChangeLog doc/interpreter/arith.txi doc/interpreter/octave.texi scripts/elfun/lcm.m scripts/general/cplxpair.m scripts/general/del2.m scripts/general/gradient.m scripts/general/mod.m scripts/general/nextpow2.m scripts/general/rem.m scripts/specfun/factor.m scripts/specfun/factorial.m scripts/specfun/pow2.m scripts/specfun/primes.m scripts/specfun/reallog.m scripts/specfun/realpow.m scripts/specfun/realsqrt.m src/DLD-FUNCTIONS/gcd.cc src/DLD-FUNCTIONS/max.cc src/data.cc src/mappers.cc
diffstat 21 files changed, 286 insertions(+), 164 deletions(-) [+]
line wrap: on
line diff
--- a/doc/ChangeLog	Mon Apr 20 12:21:34 2009 -0400
+++ b/doc/ChangeLog	Mon Apr 20 17:16:09 2009 -0700
@@ -3,6 +3,11 @@
 	* interpreter/numbers.txi: Fix small mistake in example.
 
 2009-04-17  Rik  <rdrider0-list@yahoo.com>
+	* interpreter/arith.txi: Update section 17.1 (Utility Functions) of arith.txi
+	Split section into "Exponents and Logarithms" and "Utility Functions"
+	Use Tex in many more of the doc strings for pretty printing in pdf format.
+
+2009-04-17  Rik  <rdrider0-list@yahoo.com>
 
 	* interpreter/basics.txi: Update help text for sections 2.5, 2.6, 2.7
 	of basics.txi 
--- a/doc/interpreter/arith.txi	Mon Apr 20 12:21:34 2009 -0400
+++ b/doc/interpreter/arith.txi	Mon Apr 20 17:16:09 2009 -0700
@@ -21,54 +21,36 @@
 @chapter Arithmetic
 
 Unless otherwise noted, all of the functions described in this chapter
-will work for real and complex scalar or matrix arguments.  Functions described as @dfn{mapping functions} apply the given operation to each element when given a matrix argument.
+will work for real and complex scalar, vector, or matrix arguments.  Functions
+described as @dfn{mapping functions} apply the given operation individually to 
+each element when given a matrix argument.  For example,
+
+@example
+@group
+sin ([1, 2; 3, 4])
+     @result{}  0.84147   0.90930
+         0.14112  -0.75680
+@end group
+@end example
 
 @menu
-* Utility Functions::           
+* Exponents and Logarithms::
 * Complex Arithmetic::          
 * Trigonometry::                
 * Sums and Products::           
+* Utility Functions::           
 * Special Functions::           
 * Coordinate Transformations::
 * Mathematical Constants::      
 @end menu
 
-@node Utility Functions
-@section Utility Functions
-
-The following functions are available for working with complex numbers.
-Each expects a single argument.  They are called @dfn{mapping functions}
-because when given a matrix argument, they apply the given function to
-each element of the matrix.
-
-@DOCSTRING(ceil)
-
-@DOCSTRING(cplxpair)
-
-@DOCSTRING(del2)
+@node Exponents and Logarithms
+@section Exponents and Logarithms
 
 @DOCSTRING(exp)
 
 @DOCSTRING(expm1)
 
-@DOCSTRING(factor)
-
-@DOCSTRING(factorial)
-
-@DOCSTRING(fix)
-
-@DOCSTRING(floor)
-
-@DOCSTRING(fmod)
-
-@DOCSTRING(gcd)
-
-@DOCSTRING(gradient)
-
-@DOCSTRING(hypot)
-
-@DOCSTRING(lcm)
-
 @DOCSTRING(log)
 
 @DOCSTRING(log1p)
@@ -77,38 +59,18 @@
 
 @DOCSTRING(log2)
 
-@DOCSTRING(max)
-
-@DOCSTRING(min)
-
-@DOCSTRING(cummax)
-
-@DOCSTRING(cummin)
-
-@DOCSTRING(mod)
-
 @DOCSTRING(nextpow2)
 
 @DOCSTRING(nthroot)
 
 @DOCSTRING(pow2)
 
-@DOCSTRING(primes)
-
 @DOCSTRING(reallog)
 
 @DOCSTRING(realpow)
 
 @DOCSTRING(realsqrt)
 
-@DOCSTRING(rem)
-
-@DOCSTRING(round)
-
-@DOCSTRING(roundb)
-
-@DOCSTRING(sign)
-
 @DOCSTRING(sqrt)
 
 @node Complex Arithmetic
@@ -135,6 +97,8 @@
 
 @DOCSTRING(conj)
 
+@DOCSTRING(cplxpair)
+
 @DOCSTRING(imag)
 
 @DOCSTRING(real)
@@ -227,6 +191,51 @@
 
 @DOCSTRING(accumarray)
 
+@node Utility Functions
+@section Utility Functions
+
+@DOCSTRING(ceil)
+
+@DOCSTRING(del2)
+
+@DOCSTRING(factor)
+
+@DOCSTRING(factorial)
+
+@DOCSTRING(fix)
+
+@DOCSTRING(floor)
+
+@DOCSTRING(fmod)
+
+@DOCSTRING(gcd)
+
+@DOCSTRING(gradient)
+
+@DOCSTRING(hypot)
+
+@DOCSTRING(lcm)
+
+@DOCSTRING(max)
+
+@DOCSTRING(min)
+
+@DOCSTRING(cummax)
+
+@DOCSTRING(cummin)
+
+@DOCSTRING(mod)
+
+@DOCSTRING(primes)
+
+@DOCSTRING(rem)
+
+@DOCSTRING(round)
+
+@DOCSTRING(roundb)
+
+@DOCSTRING(sign)
+
 @node Special Functions
 @section Special Functions
 
--- a/doc/interpreter/octave.texi	Mon Apr 20 12:21:34 2009 -0400
+++ b/doc/interpreter/octave.texi	Mon Apr 20 17:16:09 2009 -0700
@@ -550,10 +550,11 @@
 
 Arithmetic
 
-* Utility Functions::           
+* Exponents and Logarithms::
 * Complex Arithmetic::          
 * Trigonometry::                
 * Sums and Products::           
+* Utility Functions::           
 * Special Functions::           
 * Coordinate Transformations::
 * Mathematical Constants::      
--- a/scripts/elfun/lcm.m	Mon Apr 20 12:21:34 2009 -0400
+++ b/scripts/elfun/lcm.m	Mon Apr 20 17:16:09 2009 -0700
@@ -20,7 +20,7 @@
 ## -*- texinfo -*-
 ## @deftypefn {Mapping Function} {} lcm (@var{x}, @dots{})
 ## Compute the least common multiple of the elements of @var{x}, or
-## the list of all the arguments.  For example,
+## of the list of all arguments.  For example,
 ##
 ## @example
 ## lcm (a1, @dots{}, ak)
@@ -34,7 +34,7 @@
 ## @end example
 ##
 ## All elements must be the same size or scalar.
-## @seealso{gcd, min, max, ceil, floor}
+## @seealso{factor, gcd}
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/general/cplxpair.m	Mon Apr 20 12:21:34 2009 -0400
+++ b/scripts/general/cplxpair.m	Mon Apr 20 17:16:09 2009 -0700
@@ -17,21 +17,23 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {} cplxpair (@var{z}, @var{tol}, @var{dim})
+## @deftypefn  {Function File} {} cplxpair (@var{z})
+## @deftypefnx {Function File} {} cplxpair (@var{z}, @var{tol})
+## @deftypefnx {Function File} {} cplxpair (@var{z}, @var{tol}, @var{dim})
 ## Sort the numbers @var{z} into complex conjugate pairs ordered by 
-## increasing real part.  With identical real parts, order by increasing
-## imaginary magnitude.  Place the negative imaginary complex number
-## first within each pair.  Place all the real numbers after all the 
-## complex pairs (those with @code{abs (imag (@var{z}) / @var{z}) < 
-## @var{tol})}, where the default value of @var{tol} is @code{100 * 
-## @var{eps}}.
+## increasing real part.  Place the negative imaginary complex number
+## first within each pair.  Place all the real numbers (those with
+## @code{abs (imag (@var{z}) / @var{z}) < @var{tol})}) after the
+## complex pairs.
+##
+## If @var{tol} is unspecified the default value is 100*@var{eps}.
 ##
 ## By default the complex pairs are sorted along the first non-singleton
 ## dimension of @var{z}.  If @var{dim} is specified, then the complex
 ## pairs are sorted along this dimension.
 ##
 ## Signal an error if some complex numbers could not be paired.  Requires
-## all complex numbers to be exact conjugates within tol, or signals an 
+## all complex numbers to be exact conjugates within @var{tol}, or signals an 
 ## error.  Note that there are no guarantees on the order of the returned
 ## pairs with identical real parts but differing imaginary parts.
 ##
--- a/scripts/general/del2.m	Mon Apr 20 12:21:34 2009 -0400
+++ b/scripts/general/del2.m	Mon Apr 20 17:16:09 2009 -0700
@@ -18,11 +18,11 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {@var{d} =} del2 (@var{m})
+## @deftypefn  {Function File} {@var{d} =} del2 (@var{m})
 ## @deftypefnx {Function File} {@var{d} =} del2 (@var{m}, @var{h})
 ## @deftypefnx {Function File} {@var{d} =} del2 (@var{m}, @var{dx}, @var{dy}, @dots{})
 ##
-## Calculates the discrete Laplace operator.  If @var{m} is a matrix this is
+## Calculate the discrete Laplace operator.  If @var{m} is a matrix this is
 ## defined as
 ##
 ## @iftex
@@ -44,15 +44,16 @@
 ## derivative over the higher dimensions.
 ##
 ## The spacing between evaluation points may be defined by @var{h}, which is a
-## scalar defining the spacing in all dimensions.  Or alternatively, the spacing
+## scalar defining the equidistant spacing in all dimensions.  Alternatively, 
+## the spacing
 ## in each dimension may be defined separately by @var{dx}, @var{dy}, etc. 
 ## Scalar spacing values give equidistant spacing, whereas vector spacing 
 ## values can be used to specify variable spacing.  The length of the vectors
 ## must match the respective dimension of @var{m}.  The default spacing value
 ## is 1.
 ##
-## You need at least 3 data points for each dimension.  Boundary points are
-## calculated as the linear extrapolation of the interior points.
+## At least 3 data points are needed for each dimension.  Boundary points are
+## calculated from the linear extrapolation of interior points.
 ##
 ## @seealso{gradient, diff}
 ## @end deftypefn
--- a/scripts/general/gradient.m	Mon Apr 20 12:21:34 2009 -0400
+++ b/scripts/general/gradient.m	Mon Apr 20 17:16:09 2009 -0700
@@ -25,7 +25,7 @@
 ## @deftypefnx {Function File} {[@dots{}] =} gradient (@var{f}, @var{x0}, @var{s})
 ## @deftypefnx {Function File} {[@dots{}] =} gradient (@var{f}, @var{x0}, @var{x}, @var{y}, @dots{})
 ##
-## Calculate the gradient of sampled data, or of a function.  If @var{m}
+## Calculate the gradient of sampled data or of a function.  If @var{m}
 ## is a vector, calculate the one dimensional gradient of @var{m}.  If
 ## @var{m} is a matrix the gradient is calculated for each dimension.
 ##
@@ -56,6 +56,7 @@
 ## sampled data, the spacing values between the points from which the
 ## gradient is estimated can be set via the @var{s} or @var{dx},
 ## @var{dy}, @dots{} arguments.  By default a spacing of 1 is used.
+## @seealso{diff, del2}
 ## @end deftypefn
 
 ## Author:  Kai Habel <kai.habel@gmx.de>
--- a/scripts/general/mod.m	Mon Apr 20 12:21:34 2009 -0400
+++ b/scripts/general/mod.m	Mon Apr 20 17:16:09 2009 -0700
@@ -18,20 +18,20 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Mapping Function} {} mod (@var{x}, @var{y})
-## Compute modulo function.  Conceptually this is given by
+## Compute the modulo of @var{x} and @var{y}.  Conceptually this is given by
 ##
 ## @example
 ## x - y .* floor (x ./ y)
 ## @end example
 ##
-## and is written in a manner that the correct modulus is returned for
-##integer types.  This function handles negative values correctly.  That
-##is @code{mod (-1, 3)} is 2, not -1 as @code{rem (-1, 3)} returns.
-## Also, @code{mod (@var{x}, 0)} returns @var{x}.
+## and is written such that the correct modulus is returned for
+## integer types.  This function handles negative values correctly.  That
+## is, @code{mod (-1, 3)} is 2, not -1, as @code{rem (-1, 3)} returns.
+## @code{mod (@var{x}, 0)} returns @var{x}.
 ##
-## An error message is printed if the dimensions of the arguments do not
-## agree, or if either of the arguments is complex.
-## @seealso{rem, round}
+## An error results if the dimensions of the arguments do not agree, or if
+## either of the arguments is complex.
+## @seealso{rem, fmod}
 ## @end deftypefn
 
 ## Author: Paul Kienzle <pkienzle@kienzle.powernet.co.uk>
--- a/scripts/general/nextpow2.m	Mon Apr 20 12:21:34 2009 -0400
+++ b/scripts/general/nextpow2.m	Mon Apr 20 17:16:09 2009 -0700
@@ -19,7 +19,7 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} nextpow2 (@var{x})
-## If @var{x} is a scalar, returns the first integer @var{n} such that
+## If @var{x} is a scalar, return the first integer @var{n} such that
 ## @iftex
 ## @tex
 ##  $2^n \ge |x|$.
@@ -30,7 +30,7 @@
 ## @end ifnottex
 ##
 ## If @var{x} is a vector, return @code{nextpow2 (length (@var{x}))}.
-## @seealso{pow2}
+## @seealso{pow2, log2}
 ## @end deftypefn
 
 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
--- a/scripts/general/rem.m	Mon Apr 20 12:21:34 2009 -0400
+++ b/scripts/general/rem.m	Mon Apr 20 17:16:09 2009 -0700
@@ -19,8 +19,8 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Mapping Function} {} rem (@var{x}, @var{y})
-## Return the remainder of @code{@var{x} / @var{y}}, computed using the
-## expression
+## Return the remainder of the division @code{@var{x} / @var{y}}, computed 
+## using the expression
 ##
 ## @example
 ## x - y .* fix (x ./ y)
@@ -28,7 +28,7 @@
 ##
 ## An error message is printed if the dimensions of the arguments do not
 ## agree, or if either of the arguments is complex.
-## @seealso{mod, round}
+## @seealso{mod, fmod}
 ## @end deftypefn
 
 ## Author: jwe
--- a/scripts/specfun/factor.m	Mon Apr 20 12:21:34 2009 -0400
+++ b/scripts/specfun/factor.m	Mon Apr 20 17:16:09 2009 -0700
@@ -17,7 +17,7 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {@var{p} =} factor (@var{q})
+## @deftypefn  {Function File} {@var{p} =} factor (@var{q})
 ## @deftypefnx {Function File} {[@var{p}, @var{n}] =} factor (@var{q})
 ##
 ## Return prime factorization of @var{q}.  That is @code{prod (@var{p})
@@ -26,7 +26,7 @@
 ## With two output arguments, returns the unique primes @var{p} and
 ## their multiplicities.  That is @code{prod (@var{p} .^ @var{n}) ==
 ## @var{q}}.
-## 
+## @seealso{gcd, lcm}
 ## @end deftypefn
 
 ## Author: Paul Kienzle
--- a/scripts/specfun/factorial.m	Mon Apr 20 12:21:34 2009 -0400
+++ b/scripts/specfun/factorial.m	Mon Apr 20 17:16:09 2009 -0700
@@ -18,9 +18,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} factorial (@var{n})
-## Return the factorial of @var{n}.  If @var{n} is scalar, this is
-## equivalent to @code{prod (1:@var{n})}.  If @var{n} is an array,
-## the factorial of the elements of the array are returned.
+## Return the factorial of @var{n}.  If @var{n} is a scalar, this is
+## equivalent to @code{prod (1:@var{n})}.  For vector or matrix arguments,
+## return the factorial of each element in the array.
 ## @end deftypefn
 
 function x = factorial (n)
--- a/scripts/specfun/pow2.m	Mon Apr 20 12:21:34 2009 -0400
+++ b/scripts/specfun/pow2.m	Mon Apr 20 17:16:09 2009 -0700
@@ -29,7 +29,9 @@
 ## @ifnottex
 ##  2 .^ x
 ## @end ifnottex
-## for each element of @var{x}.  With two arguments, returns
+## for each element of @var{x}.
+##
+## With two arguments, returns
 ## @iftex
 ## @tex
 ##  $f \cdot 2^e$.
@@ -38,7 +40,7 @@
 ## @ifnottex
 ##  f .* (2 .^ e).
 ## @end ifnottex
-## @seealso{nextpow2}
+## @seealso{log2, nextpow2}
 ## @end deftypefn
 
 ## Author: AW <Andreas.Weingessel@ci.tuwien.ac.at>
--- a/scripts/specfun/primes.m	Mon Apr 20 12:21:34 2009 -0400
+++ b/scripts/specfun/primes.m	Mon Apr 20 17:16:09 2009 -0700
@@ -21,12 +21,12 @@
 ##
 ## Return all primes up to @var{n}.  
 ##
+## The algorithm used is the Sieve of Erastothenes.
+##
 ## Note that if you need a specific number of primes, you can use the
 ## fact the distance from one prime to the next is on average
 ## proportional to the logarithm of the prime.  Integrating, you find
 ## that there are about @math{k} primes less than @math{k \log (5 k)}.
-##
-## The algorithm used is called the Sieve of Erastothenes.
 ## @end deftypefn
 
 ## Author: Paul Kienzle
--- a/scripts/specfun/reallog.m	Mon Apr 20 12:21:34 2009 -0400
+++ b/scripts/specfun/reallog.m	Mon Apr 20 17:16:09 2009 -0700
@@ -18,9 +18,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} reallog (@var{x})
-## Return the real natural logarithm of @var{x}.  If any element results in the
-## return value being complex @code{reallog} produces an error.
-## @seealso{log, realsqrt, realpow}
+## Return the real-valued natural logarithm of each element of @var{x}.  Report 
+## an error if any element results in a complex return value.
+## @seealso{log, realpow, realsqrt}
 ## @end deftypefn
 
 function y = reallog (x)
--- a/scripts/specfun/realpow.m	Mon Apr 20 12:21:34 2009 -0400
+++ b/scripts/specfun/realpow.m	Mon Apr 20 17:16:09 2009 -0700
@@ -18,9 +18,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} realpow (@var{x}, @var{y})
-## Return the element by element power operator.  This is equivalent to
-## @code{@var{x} .^ @var{y}}, except that if the return value
-## is complex @code{realpow} produces an error.
+## Compute the real-valued, element-by-element power operator.  This is 
+## equivalent to @w{@code{@var{x} .^ @var{y}}}, except that @code{realpow}
+## reports an error if any return value is complex.
 ## @seealso{reallog, realsqrt}
 ## @end deftypefn
 
--- a/scripts/specfun/realsqrt.m	Mon Apr 20 12:21:34 2009 -0400
+++ b/scripts/specfun/realsqrt.m	Mon Apr 20 17:16:09 2009 -0700
@@ -18,9 +18,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} realsqrt (@var{x})
-## Return the real sqrt of @var{x}.  If any element results in the
-## return value being complex @code{realsqrt} produces an error.
-## @seealso{sqrt, reallog, realpow}
+## Return the real-valued square root of each element of @var{x}.  Report an
+## error if any element results in a complex return value.
+## @seealso{sqrt, realpow, reallog}
 ## @end deftypefn
 
 function y = realsqrt (x)
--- a/src/DLD-FUNCTIONS/gcd.cc	Mon Apr 20 12:21:34 2009 -0400
+++ b/src/DLD-FUNCTIONS/gcd.cc	Mon Apr 20 17:16:09 2009 -0700
@@ -51,14 +51,14 @@
 
 DEFUN_DLD (gcd, args, nargout,
   "-*- texinfo -*-\n\
-@deftypefn {Loadable Function} {@var{g} =} gcd (@var{a1}, @dots{})\n\
-@deftypefnx {Loadable Function} {[@var{g}, @var{v1}, @dots{}] =} gcd (@var{a1}, @dots{})\n\
+@deftypefn  {Loadable Function} {@var{g} =} gcd (@var{a})\n\
+@deftypefnx {Loadable Function} {@var{g} =} gcd (@var{a1}, @var{a2}, @dots{})\n\
+@deftypefnx {Loadable Function} {[@var{g}, @var{v1}, @dots{}] =} gcd (@var{a1}, @var{a2}, @dots{})\n\
 \n\
-If a single argument is given then compute the greatest common divisor of\n\
-the elements of this argument.  Otherwise if more than one argument is\n\
-given all arguments must be the same size or scalar.  In this case the\n\
-greatest common divisor is calculated for element individually.  All\n\
-elements must be integers.  For example,\n\
+Compute the greatest common divisor of the elements of @var{a}.  If more\n\
+than one argument is given all arguments must be the same size or scalar.\n\
+  In this case the greatest common divisor is calculated for each element\n\
+individually.  All elements must be integers.  For example,\n\
 \n\
 @example\n\
 @group\n\
@@ -72,12 +72,12 @@
 \n\
 @example\n\
 @group\n\
-gcd ([15, 9], [20 18])\n\
+gcd ([15, 9], [20, 18])\n\
     @result{}  5  9\n\
 @end group\n\
 @end example\n\
 \n\
-Optional return arguments @var{v1}, etc, contain integer vectors such\n\
+Optional return arguments @var{v1}, etc., contain integer vectors such\n\
 that,\n\
 \n\
 @ifnottex\n\
@@ -94,7 +94,7 @@
 For backward compatibility with previous versions of this function, when\n\
 all arguments are scalar, a single return argument @var{v1} containing\n\
 all of the values of @var{v1}, @dots{} is acceptable.\n\
-@seealso{lcm, min, max, ceil, floor}\n\
+@seealso{lcm, factor}\n\
 @end deftypefn")
 {
   octave_value_list retval;
--- a/src/DLD-FUNCTIONS/max.cc	Mon Apr 20 12:21:34 2009 -0400
+++ b/src/DLD-FUNCTIONS/max.cc	Mon Apr 20 17:16:09 2009 -0700
@@ -684,9 +684,10 @@
 
 DEFUN_DLD (min, args, nargout,
   "-*- texinfo -*-\n\
-@deftypefn {Loadable Function} {} min (@var{x}, @var{y}, @var{dim})\n\
+@deftypefn  {Loadable Function} {} min (@var{x})\n\
+@deftypefnx {Loadable Function} {} min (@var{x}, @var{y})\n\
+@deftypefnx {Loadable Function} {} min (@var{x}, @var{y}, @var{dim})\n\
 @deftypefnx {Loadable Function} {[@var{w}, @var{iw}] =} min (@var{x})\n\
-@cindex Utility Functions\n\
 For a vector argument, return the minimum value.  For a matrix\n\
 argument, return the minimum value from each column, as a row\n\
 vector, or over the dimension @var{dim} if defined.  For two matrices\n\
@@ -724,6 +725,7 @@
         ix = 3\n\
 @end group\n\
 @end example\n\
+@seealso{max, cummin, cummax}\n\
 @end deftypefn")
 {
   MINMAX_BODY (min);
@@ -758,9 +760,10 @@
 
 DEFUN_DLD (max, args, nargout,
   "-*- texinfo -*-\n\
-@deftypefn {Loadable Function} {} max (@var{x}, @var{y}, @var{dim})\n\
+@deftypefn  {Loadable Function} {} max (@var{x})\n\
+@deftypefnx {Loadable Function} {} max (@var{x}, @var{y})\n\
+@deftypefnx {Loadable Function} {} max (@var{x}, @var{y}, @var{dim})\n\
 @deftypefnx {Loadable Function} {[@var{w}, @var{iw}] =} max (@var{x})\n\
-@cindex Utility Functions\n\
 For a vector argument, return the maximum value.  For a matrix\n\
 argument, return the maximum value from each column, as a row\n\
 vector, or over the dimension @var{dim} if defined.  For two matrices\n\
@@ -772,7 +775,7 @@
 @end example\n\
 \n\
 @noindent\n\
-returns the largest element of @var{x}, and\n\
+returns the largest element of the matrix @var{x}, and\n\
 \n\
 @example\n\
 @group\n\
@@ -798,6 +801,7 @@
         ix = 3\n\
 @end group\n\
 @end example\n\
+@seealso{min, cummax, cummin}\n\
 @end deftypefn")
 {
   MINMAX_BODY (max);
@@ -914,10 +918,21 @@
 
 DEFUN_DLD (cummin, args, nargout,
   "-*- texinfo -*-\n\
-@deftypefn {Loadable Function} {} cummin (@var{x}, @var{dim})\n\
+@deftypefn  {Loadable Function} {} cummin (@var{x})\n\
+@deftypefnx {Loadable Function} {} cummin (@var{x}, @var{dim})\n\
 @deftypefnx {Loadable Function} {[@var{w}, @var{iw}] =} cummin (@var{x})\n\
-@cindex Utility Functions\n\
-Return the cumulative minimum values.  That means, the call\n\
+Return the cumulative minimum values along dimension @var{dim}.  If @var{dim}\n\
+is unspecified it defaults to column-wise operation.  For example,\n\
+\n\
+@example\n\
+@group\n\
+cummin ([5 4 6 2 3 1])\n\
+    @result{}  5  4  4  2  2  1\n\
+@end group\n\
+@end example\n\
+\n\
+\n\
+The call\n\
 @example\n\
   [w, iw] = cummin (x, dim)\n\
 @end example\n\
@@ -926,20 +941,18 @@
 is equivalent to the following code:\n\
 @example\n\
 @group\n\
-  w = iw = zeros (size (x));\n\
-  idxw = idxx = repmat (@{':'@}, 1, ndims (x));\n\
-  for i = 1:size (x, dim)\n\
-    idxw@{dim@} = i; idxx@{dim@} = 1:i;\n\
-    [w(idxw@{:@}), iw(idxw@{:@})] =\\n\
- min(x(idxx@{:@}), [], dim);\n\
-  endfor\n\
+w = iw = zeros (size (x));\n\
+idxw = idxx = repmat (@{':'@}, 1, ndims (x));\n\
+for i = 1:size (x, dim)\n\
+  idxw@{dim@} = i; idxx@{dim@} = 1:i;\n\
+  [w(idxw@{:@}), iw(idxw@{:@})] = min(x(idxx@{:@}), [], dim);\n\
+endfor\n\
 @end group\n\
 @end example\n\
 \n\
 @noindent\n\
 but computed in a much faster manner.\n\
-The behavior if @var{dim} or @var{iw} is unspecified is analogous\n\
-to @code{min}.\n\
+@seealso{cummax, min, max}\n\
 @end deftypefn")
 {
   CUMMINMAX_BODY (cummin);
@@ -947,32 +960,40 @@
 
 DEFUN_DLD (cummax, args, nargout,
   "-*- texinfo -*-\n\
-@deftypefn {Loadable Function} {} cummax (@var{x}, @var{dim})\n\
+@deftypefn  {Loadable Function} {} cummax (@var{x})\n\
+@deftypefnx {Loadable Function} {} cummax (@var{x}, @var{dim})\n\
 @deftypefnx {Loadable Function} {[@var{w}, @var{iw}] =} cummax (@var{x})\n\
-@cindex Utility Functions\n\
-Return the cumulative maximum values.  That means, the call\n\
+Return the cumulative maximum values along dimension @var{dim}.  If @var{dim}\n\
+is unspecified it defaults to column-wise operation.  For example,\n\
+\n\
 @example\n\
-  [w, iw] = cummax (x, dim)\n\
+@group\n\
+cummax ([1 3 2 6 4 5])\n\
+    @result{}  1  3  3  6  6  6\n\
+@end group\n\
+@end example\n\
+\n\
+The call\n\
+@example\n\
+[w, iw] = cummax (x, dim)\n\
 @end example\n\
 \n\
 @noindent\n\
 is equivalent to the following code:\n\
 @example\n\
 @group\n\
-  w = iw = zeros (size (x));\n\
-  idxw = idxx = repmat (@{':'@}, 1, ndims (x));\n\
-  for i = 1:size (x, dim)\n\
-    idxw@{dim@} = i; idxx@{dim@} = 1:i;\n\
-    [w(idxw@{:@}), iw(idxw@{:@})] =\\n\
- max(x(idxx@{:@}), [], dim);\n\
-  endfor\n\
+w = iw = zeros (size (x));\n\
+idxw = idxx = repmat (@{':'@}, 1, ndims (x));\n\
+for i = 1:size (x, dim)\n\
+  idxw@{dim@} = i; idxx@{dim@} = 1:i;\n\
+  [w(idxw@{:@}), iw(idxw@{:@})] = max(x(idxx@{:@}), [], dim);\n\
+endfor\n\
 @end group\n\
 @end example\n\
 \n\
 @noindent\n\
 but computed in a much faster manner.\n\
-The behavior if @var{dim} or @var{iw} is unspecified is analogous\n\
-to @code{max}.\n\
+@seealso{cummin, max, min}\n\
 @end deftypefn")
 {
   CUMMINMAX_BODY (cummax);
--- a/src/data.cc	Mon Apr 20 12:21:34 2009 -0400
+++ b/src/data.cc	Mon Apr 20 17:16:09 2009 -0700
@@ -735,9 +735,9 @@
 
 DEFUN (hypot, args, ,
   "-*- texinfo -*-\n\
-@deftypefn {Mapping Function} {} hypot (@var{x}, @var{y})\n\
-Compute square-root of the squares of @var{x} and @var{y}\n\
-element-by-element.  This equivalent to @code{sqrt (@var{x}.^ 2 + @var{y}\n\
+@deftypefn {Built-in Function} {} hypot (@var{x}, @var{y})\n\
+Compute the element-by-element square root of the squares of @var{x} and\n\
+@var{y}.  This is equivalent to @code{sqrt (@var{x}.^ 2 + @var{y}\n\
 .^ 2)}, but calculated in a manner that avoids overflows for large\n\
 values of @var{x} or @var{y}.\n\
 @end deftypefn")
@@ -993,11 +993,20 @@
   "-*- texinfo -*-\n\
 @deftypefn {Mapping Function} {} log2 (@var{x})\n\
 @deftypefnx {Mapping Function} {[@var{f}, @var{e}] =} log2 (@var{x})\n\
-Compute the base-2 logarithm for each element of @var{x}.\n\
-If called with two output arguments, split @var{x} to\n\
-binary mantissa and exponent so that @code{1/2 <= abs(f) < 1} and\n\
-@var{e} is an integer.  If @code{x = 0}, @code{f = e = 0}.\n\
-@seealso{log, log10, log2, exp}\n\
+Compute the base-2 logarithm of each element of @var{x}.\n\
+\n\
+If called with two output arguments, split @var{x} into\n\
+binary mantissa and exponent so that\n\
+@iftex\n\
+@tex\n\
+${1 \\over 2} \\le \\left| f \\right| < 1$\n\
+@end tex\n\
+@end iftex\n\
+@ifnottex\n\
+@code{1/2 <= abs(f) < 1}\n\ 
+@end ifnottex\n\
+and @var{e} is an integer.  If @code{x = 0}, @code{f = e = 0}.\n\
+@seealso{pow2, log, log10, exp}\n\
 @end deftypefn")
 {
   octave_value_list retval;
@@ -1081,7 +1090,8 @@
 @deftypefn {Mapping Function} {} fmod (@var{x}, @var{y})\n\
 Compute the floating point remainder of dividing @var{x} by @var{y}\n\
 using the C library function @code{fmod}.  The result has the same\n\
-sign as @var{x}.  If @var{y} is zero, the result is implementation-defined.\n\
+sign as @var{x}.  If @var{y} is zero, the result is implementation-dependent.\n\
+@seealso{mod, rem}\n\
 @end deftypefn")
 {
   octave_value retval;
--- a/src/mappers.cc	Mon Apr 20 12:21:34 2009 -0400
+++ b/src/mappers.cc	Mon Apr 20 17:16:09 2009 -0700
@@ -345,8 +345,16 @@
 DEFUN (ceil, args, ,
     "-*- texinfo -*-\n\
 @deftypefn {Mapping Function} {} ceil (@var{x})\n\
-Return the smallest integer not less than @var{x}.  If @var{x} is\n\
+Return the smallest integer not less than @var{x}.  This is equivalent to\n\
+rounding towards positive infinity.  If @var{x} is\n\
 complex, return @code{ceil (real (@var{x})) + ceil (imag (@var{x})) * I}.\n\
+@example\n\
+@group\n\
+ceil ([-2.7, 2.7])\n\
+   @result{}  -2   3\n\
+@end group\n\
+@end example\n\
+@seealso{floor, round, fix}\n\
 @end deftypefn")
 {
   octave_value retval;
@@ -586,8 +594,18 @@
 DEFUN (exp, args, ,
     "-*- texinfo -*-\n\
 @deftypefn {Mapping Function} {} exp (@var{x})\n\
-Compute the exponential of @var{x}.  To compute the matrix exponential,\n\
-see @ref{Linear Algebra}.\n\
+Compute\n\
+@iftex\n\
+@tex\n\
+$e^{x}$\n\
+@end tex\n\
+@end iftex\n\
+@ifnottex\n\
+@code{e^x}\n\
+@end ifnottex\n\
+for each element of @var{x}.  To compute the matrix\n\
+exponential, see @ref{Linear Algebra}.\n\
+@seealso{log}\n\
 @end deftypefn")
 {
   octave_value retval;
@@ -617,7 +635,17 @@
 DEFUN (expm1, args, ,
     "-*- texinfo -*-\n\
 @deftypefn {Mapping Function} {} expm1 (@var{x})\n\
-Compute exp (@var{x}) - 1 accurately in neighborhood of zero.\n\
+Compute \n\
+@iftex\n\
+@tex\n\
+$ e^{x} - 1 $\n\
+@end tex\n\
+@end iftex\n\
+@ifnottex\n\
+@code{exp (@var{x}) - 1}\n\
+@end ifnottex\n\
+accurately in the neighborhood of zero.\n\
+@seealso{exp}\n\
 @end deftypefn")
 {
   octave_value retval;
@@ -667,8 +695,16 @@
 DEFUN (fix, args, ,
     "-*- texinfo -*-\n\
 @deftypefn {Mapping Function} {} fix (@var{x})\n\
-Truncate @var{x} toward zero.  If @var{x} is complex, return\n\
+Truncate fractional portion of @var{x} and return integer portion.  This\n\
+is equivalent to rounding towards zero.  If @var{x} is complex, return\n\
 @code{fix (real (@var{x})) + fix (imag (@var{x})) * I}.\n\
+@example\n\
+@group\n\
+fix ([-2.7, 2.7])\n\
+   @result{} -2   2\n\
+@end group\n\
+@end example\n\
+@seealso{ceil, floor, round}\n\
 @end deftypefn")
 {
   octave_value retval;
@@ -695,8 +731,16 @@
 DEFUN (floor, args, ,
     "-*- texinfo -*-\n\
 @deftypefn {Mapping Function} {} floor (@var{x})\n\
-Return the largest integer not greater than @var{x}.  If @var{x} is\n\
+Return the largest integer not greater than @var{x}.  This is equivalent to\n\
+rounding towards negative infinity.  If @var{x} is\n\
 complex, return @code{floor (real (@var{x})) + floor (imag (@var{x})) * I}.\n\
+@example\n\
+@group\n\
+floor ([-2.7, 2.7])\n\
+     @result{} -3   2\n\
+@end group\n\
+@end example\n\
+@seealso{ceil, round, fix}\n\
 @end deftypefn")
 {
   octave_value retval;
@@ -1159,9 +1203,18 @@
 DEFUN (log, args, ,
     "-*- texinfo -*-\n\
 @deftypefn {Mapping Function} {} log (@var{x})\n\
-Compute the natural logarithm for each element of @var{x}.  To compute the\n\
+Compute the natural logarithm,\n\
+@iftex\n\
+@tex\n\
+$\\ln{(x)},$\n\
+@end tex\n\
+@end iftex\n\
+@ifnottex\n\
+@code{ln (@var{x})},\n\
+@end ifnottex\n\
+for each element of @var{x}.  To compute the\n\
 matrix logarithm, see @ref{Linear Algebra}.\n\
-@seealso{log2, log10, logspace, exp}\n\
+@seealso{exp, log1p, log2, log10, logspace}\n\
 @end deftypefn")
 {
   octave_value retval;
@@ -1189,7 +1242,7 @@
 DEFUN (log10, args, ,
     "-*- texinfo -*-\n\
 @deftypefn {Mapping Function} {} log10 (@var{x})\n\
-Compute the base-10 logarithm for each element of @var{x}.\n\
+Compute the base-10 logarithm of each element of @var{x}.\n\
 @seealso{log, log2, logspace, exp}\n\
 @end deftypefn")
 {
@@ -1215,7 +1268,17 @@
 DEFUN (log1p, args, ,
     "-*- texinfo -*-\n\
 @deftypefn {Mapping Function} {} log1p (@var{x})\n\
-Compute log (1 + @var{x}) accurately in neighborhood of zero.\n\
+Compute\n\
+@iftex\n\
+@tex\n\
+$\\ln{(1 + x)}$\n\
+@end tex\n\
+@end iftex\n\
+@ifnottex\n\
+@code{log (1 + @var{x})}\n\
+@end ifnottex\n\
+accurately in the neighborhood of zero.\n\
+@seealso{log, exp, expm1}\n\
 @end deftypefn")
 {
   octave_value retval;
@@ -1265,7 +1328,13 @@
 @deftypefn {Mapping Function} {} round (@var{x})\n\
 Return the integer nearest to @var{x}.  If @var{x} is complex, return\n\
 @code{round (real (@var{x})) + round (imag (@var{x})) * I}.\n\
-@seealso{rem}\n\
+@example\n\
+@group\n\
+round ([-2.7, 2.7])\n\
+     @result{} -3   3\n\
+@end group\n\
+@end example\n\
+@seealso{ceil, floor, fix}\n\
 @end deftypefn")
 {
   octave_value retval;
@@ -1306,7 +1375,7 @@
 Return the integer nearest to @var{x}.  If there are two nearest\n\
 integers, return the even one (banker's rounding).  If @var{x} is complex,\n\
 return @code{roundb (real (@var{x})) + roundb (imag (@var{x})) * I}.\n\
-@seealso{rem}\n\
+@seealso{round}\n\
 @end deftypefn")
 {
   octave_value retval;
@@ -1440,9 +1509,10 @@
 DEFUN (sqrt, args, ,
     "-*- texinfo -*-\n\
 @deftypefn {Mapping Function} {} sqrt (@var{x})\n\
-Compute the square root of @var{x}.  If @var{x} is negative, a complex\n\
-result is returned.  To compute the matrix square root, see\n\
+Compute the square root of each element of @var{x}.  If @var{x} is negative,\n\
+a complex result is returned.  To compute the matrix square root, see\n\
 @ref{Linear Algebra}.\n\
+@seealso{realsqrt}\n\
 @end deftypefn")
 {
   octave_value retval;