X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=doc%2Fgcd.texi;h=21d6bd4227432c6c2e846c06e2938343dd99939a;hb=72fa964ff7b6a1e8359c83e34765af885fc60ebe;hp=b874cd53fc6d5236f264e03eb2f5059a4e831b35;hpb=9604c32d67c6cdf40ee38c39f5e2497403bc5fd2;p=gnulib.git diff --git a/doc/gcd.texi b/doc/gcd.texi index b874cd53f..21d6bd422 100644 --- a/doc/gcd.texi +++ b/doc/gcd.texi @@ -2,6 +2,15 @@ @section gcd: greatest common divisor @findex gcd +@c Copyright (C) 2006, 2009-2012 Free Software Foundation, Inc. + +@c Permission is granted to copy, distribute and/or modify this document +@c under the terms of the GNU Free Documentation License, Version 1.3 or +@c any later version published by the Free Software Foundation; with no +@c Invariant Sections, with no Front-Cover Texts, and with no Back-Cover +@c Texts. A copy of the license is included in the ``GNU Free +@c Documentation License'' file as part of this distribution. + The @code{gcd} function returns the greatest common divisor of two numbers @code{a > 0} and @code{b > 0}. It is the caller's responsibility to ensure that the arguments are non-zero. @@ -26,8 +35,8 @@ WORD_T GCD (WORD_T a, WORD_T b); If you need the least common multiple of two numbers, it can be computed like this: @code{lcm(a,b) = (a / gcd(a,b)) * b} or @code{lcm(a,b) = a * (b / gcd(a,b))}. -Avoid the formula @code{lcm(a,b) = (a * b) / gcd(a,b)} because - although -mathematically correct - it can yield a wrong result, due to integer overflow. +Avoid the formula @code{lcm(a,b) = (a * b) / gcd(a,b)} because---although +mathematically correct---it can yield a wrong result, due to integer overflow. In some applications it is useful to have a function taking the gcd of two signed numbers. In this case, the gcd function result is usually normalized