gcd 0 0 = 0

Marc van Dongen dongen@cs.ucc.ie
Fri, 14 Dec 2001 12:38:58 +0000

Simon Peyton Jones (simonpj@microsoft.com) wrote:

: If someone could write a sentence or two to explain why gcd 0 0 = 0,
: (ideally, brief ones I can put in the report by way of explanation),
: I think that might help those of us who have not followed the details
: of the discussion.  

Division in the context of gcds (of integers) is usually defined
along the lines of:
  An integer $a$ divides integer $b$ if there exists an integer
  $c$ such that $a c= b$.
Note that here division is a *relation* an not a *function*/*operator*.
Given the definition of division being a relation it makes perfect
sense to say that $0$ divides $0$ which is why
 gcd 0 0 = 0; and
 gcd 0 0 /= error "Blah"
The gcd of two integers is usually defined as a non-negative
number to make it unique.


PS: I am strongly in favour of gcd 0 0 = 0.


Marc van Dongen