GCD in Fractions

blindanagram noone at nowhere.net
Wed Sep 24 09:25:42 EDT 2014


On 24/09/2014 12:44, Steven D'Aprano wrote:

> blindanagram wrote:
[snip]
> - Mathworld says that GCD of two negative numbers is a negative number;
> 
> - but Mathematica says that GCD of two negative numbers is a positive;
> 
> - Wikipedia agrees with Mathematica and disagrees with Mathworld;

After looking at these (and several other) on-line mathematical sites, I
realised that I would have to go back to long standing mathemmatical
references to find how the gcd is defined by those that explicitly cover
the greatest common divisor for negative integers (I did this before
raising the issue here).

All four that I have so far looked at have definitions that lead to
gcd(a, b) for integers being equal to gcd(|a|, |b|). I hope to visit a
University library shortly to review more.  Does anyone know of such a
reference that uses a definition that conflicts with gcd(a, b) for
integers being equal to gcd(|a|, |b|)?




More information about the Python-list mailing list