gcd 0 0 = 0
Simon Peyton-Jones
simonpj@microsoft.com
Fri, 14 Dec 2001 01:18:56 -0800
| Probably, the best specification would be
|=20
| gcd n m :: Integer =3D if n =3D=3D 0 && m =3D=3D 0 then 0
| else
| greatest integer that divides both n and m
Well, thank you all those that have contributed. My original point
was simply to say
greatest (positive) integer that divides both n and m
but debate seems to have swirled round whether (gcd 0 0) should
be 0 or an error. Currently in H98 it's an error; but it is the kind=20
of thing I'm willing to change IF there is a consensus, because it
will only make more programs work. Is there a consensus that
such a change would be desirable?
If someone could write a sentence or two to explain why gcd 0 0 =3D 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. =20
Simon