# HG changeset patch # User Rik # Date 1411442560 25200 # Node ID 8b3b35fda568dd2e18c50dad1f26dee509627cbd # Parent e278c939a41917d4a7af7c1bc1bf0818d9400bcf 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. diff -r e278c939a419 -r 8b3b35fda568 libinterp/corefcn/gcd.cc --- 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;