define gcd 0 0 = 0 (Ticket #3304)

As much as I'd love gcd 0 0 to be 0, the major problem is that this change would contradict the Haskell 98 report. Persumably the Haskell report needs to be changed first. Is there a ticket for this for Haskell prime? I didn't find one. -- Russell O'Connor http://r6.ca/ ``All talk about `theft,''' the general counsel of the American Graphophone Company wrote, ``is the merest claptrap, for there exists no property in ideas musical, literary or artistic, except as defined by statute.''

On Tue, 7 Jul 2009, roconnor@theorem.ca wrote:
As much as I'd love gcd 0 0 to be 0, the major problem is that this change would contradict the Haskell 98 report.
There was a long thread about this issue some years ago that came to the conclusion that the current behaviour of gcd is algebraically most sound.

Henning Thielemann antwortete roconnor@theorem.ca:
As much as I'd love gcd 0 0 to be 0, the major problem is that this change would contradict the Haskell 98 report.
There was a long thread about this issue some years ago that came to the conclusion that the current behaviour of gcd is algebraically most sound.
Huh? Algebraically, gcd is the binary greatest-lower-bound operation in the divisibility ordering of the naturals, or in the divisibility preordering on the integers. In both, 0 is the unique top element (everything divides zero). Therefore, ``gcd 0 0 = 0'' is even ``more algebraically justified'' than ``gcd (-2) (-6) = 2'', which is what both hugs and ghc produce. Wolfram
participants (3)
-
Henning Thielemann
-
kahl@cas.mcmaster.ca
-
roconnor@theorem.ca