2 gcd - greatest common divisor of a set of rational numbers
8 x1, x2, ... rational number
10 return rational number
13 If at least one xi is nonzero, gcd(x1, x2, ...) is the
14 greatest positive number g for which each xi is a multiple of g.
15 If all xi are zero, the gcd is zero.
18 ; print gcd(12, -24, 30), gcd(9/10, 11/5, 4/25), gcd(0,0,0,0,0)
22 The number of arguments may not to exceed 1024.
25 NUMBER *qgcd(NUMBER *x1, NUMBER *x2)
30 ## Copyright (C) 1999-2006 Landon Curt Noll
32 ## Calc is open software; you can redistribute it and/or modify it under
33 ## the terms of the version 2.1 of the GNU Lesser General Public License
34 ## as published by the Free Software Foundation.
36 ## Calc is distributed in the hope that it will be useful, but WITHOUT
37 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
38 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
39 ## Public License for more details.
41 ## A copy of version 2.1 of the GNU Lesser General Public License is
42 ## distributed with calc under the filename COPYING-LGPL. You should have
43 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
44 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
46 ## @(#) $Revision: 30.1 $
47 ## @(#) $Id: gcd,v 30.1 2007/03/16 11:10:42 chongo Exp $
48 ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/gcd,v $
50 ## Under source code control: 1995/10/05 04:52:26
51 ## File existed as early as: 1995
53 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
54 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/