changeset 19149:8b3b35fda568

doc: Improve docstring for gcd. * gcd.cc (Fgcd): Don't use @var{} on imaginary unit i. Move example code to bottom of docstring. Add seealso link to isprime.
author Rik <rik@octave.org>
date Mon, 22 Sep 2014 20:22:40 -0700
parents e278c939a419
children adb102face2d
files libinterp/corefcn/gcd.cc
diffstat 1 files changed, 18 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/gcd.cc	Mon Sep 22 20:19:01 2014 -0700
+++ b/libinterp/corefcn/gcd.cc	Mon Sep 22 20:22:40 2014 -0700
@@ -441,25 +441,16 @@
        "-*- texinfo -*-\n\
 @deftypefn  {Built-in Function} {@var{g} =} gcd (@var{a1}, @var{a2}, @dots{})\n\
 @deftypefnx {Built-in Function} {[@var{g}, @var{v1}, @dots{}] =} gcd (@var{a1}, @var{a2}, @dots{})\n\
-\n\
-Compute the greatest common divisor of @var{a1}, @var{a2}, @dots{}.  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 ordinary or Gaussian (complex)\n\
-integers.  Note that for Gaussian integers, the gcd is not unique up to\n\
-units (multiplication by 1, -1, @var{i} or -@var{i}), so an arbitrary\n\
-greatest common divisor amongst four possible is returned.\n\
+Compute the greatest common divisor of @var{a1}, @var{a2}, @dots{}.\n\
 \n\
-Example code:\n\
+If more than one argument is given then all arguments must be the same size\n\
+or scalar.  In this case the greatest common divisor is calculated for each\n\
+element individually.  All elements must be ordinary or Gaussian (complex)\n\
+integers.  Note that for Gaussian integers, the gcd is only unique up to a\n\
+phase factor (multiplication by 1, -1, i, or -i), so an arbitrary greatest\n\
+common divisor amongst four possible is returned.\n\
 \n\
-@example\n\
-@group\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}, @dots{}, contain integer vectors such\n\
 that,\n\
 \n\
 @tex\n\
@@ -473,7 +464,16 @@
 \n\
 @end ifnottex\n\
 \n\
-@seealso{lcm, factor}\n\
+Example code:\n\
+\n\
+@example\n\
+@group\n\
+gcd ([15, 9], [20, 18])\n\
+   @result{}  5  9\n\
+@end group\n\
+@end example\n\
+\n\
+@seealso{lcm, factor, isprime}\n\
 @end deftypefn")
 {
   octave_value_list retval;