Re: [GHC] #3304: define gcd 0 0 = 0

2011-06-26 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: closed Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-06-13 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: closed Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-06-12 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: closed Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-06-12 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: closed Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-06-12 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: closed Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-06-12 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: closed Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-06-12 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: closed Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-06-11 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: patch Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-05-29 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: patch Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-05-29 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: patch Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-05-18 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: patch Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-05-18 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: patch Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-05-10 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: new Priority: normal | Milestone: Not GHC

Re: [GHC] #3304: define gcd 0 0 = 0

2011-05-10 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: new Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2011-05-10 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: new Priority: normal | Milestone: 7.2.1

Re: [GHC] #3304: define gcd 0 0 = 0

2010-05-04 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec | Owner: Type: proposal| Status: closed Priority: normal | Milestone: Not GHC

Re: [GHC] #3304: define gcd 0 0 = 0

2009-07-12 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec|Owner: Type: proposal | Status: new Priority: normal|Milestone: Not GHC

Re: [GHC] #3304: define gcd 0 0 = 0

2009-07-08 Thread GHC
#3304: define gcd 0 0 = 0 --+- Reporter: stevec| Owner: Type: proposal | Status: new Priority: normal| Milestone

[GHC] #3304: define gcd 0 0 = 0

2009-06-14 Thread GHC
#3304: define gcd 0 0 = 0 -+-- Reporter: stevec| Owner: Type: proposal | Status: new Priority: normal| Component: libraries/base

RE: gcd 0 0 = 0

2001-12-19 Thread Kent Karlsson
PROTECTED]]On Behalf Of Jan de Wit Sent: den 19 december 2001 01:15 To: [EMAIL PROTECTED] Subject: Re: gcd 0 0 = 0 Why not define gcd a b as the largest (in 'normal' order) integer d such that the set of sums of multiples of a and b {na+mb | n - Z, m - Z} is equal to the set of multiples of d

Re: gcd 0 0 = 0

2001-12-18 Thread Marc van Dongen
Ch. A. Herrmann ([EMAIL PROTECTED]) wrote: : In contrast, 0*x=0, thus 0 divides 0 (somehow). : But I have problems with gcd being the greatest positive integer ... [snip] : - 0 is not positive, it is non-negative or natural : - 2 also divides 0 and 2 is a greater integer than 0 : (0 is the

Re: gcd 0 0 = 0

2001-12-18 Thread Marc van Dongen
if the report just : says: : :In order to make the non-negative integers into a lattice under `gcd' :and `lcm', we define `gcd 0 0 = 0'. It would surely make things a lot less accessible to people (including me) who do not have any (or limited) knowledge about lattices. Why not make

RE: gcd 0 0 = 0

2001-12-18 Thread Ch. A. Herrmann
Simon == Simon Peyton-Jones [EMAIL PROTECTED] writes: Simon Christoph does not like this It's OK if the definition is clear; it wasn't using the words positive or greatest integer. Stating gcd 0 0 = 0 explicitly is a good thing, even if it could be expressed verbatim; people may think

Re: gcd 0 0 = 0

2001-12-18 Thread Lars Henrik Mathiesen
' :and `lcm', we define `gcd 0 0 = 0'. It would surely make things a lot less accessible to people (including me) who do not have any (or limited) knowledge about lattices. Why not make it more accessible and use the following rule (ore something similar)? The greates common divison (gcd) of two

Re: gcd 0 0 = 0

2001-12-18 Thread Marc van Dongen
Lars Henrik Mathiesen ([EMAIL PROTECTED]) wrote: : Alan Bawden ([EMAIL PROTECTED]) wrote: : : Indeed, that's a nice way of putting it. How about if the report just : : says: : : : :In order to make the non-negative integers into a lattice under `gcd' : :and `lcm', we define `gcd

RE: gcd 0 0 = 0

2001-12-18 Thread Kent Karlsson
(in the ordinary sense) divisor of 0. Indeed, +infinity is a much larger divisor of 0... I'm not in favour of using a very special-purpose order, not used for anything else, and that isn't even an order but a preorder, just to motivate gcd 0 0 = 0. Even if using this very special-purpose preorder

Re: gcd 0 0 = 0

2001-12-18 Thread Dylan Thurston
they are defined (with gcd 0 0 = 0). As I said, I was surprised; to me, the definiton with all a and b is the more natural one. I still recommend using the full domain (especially since exceptions are awkward to deal with in Haskell), but I'm not as certain. Best, Dylan Thurston

Re: gcd 0 0 = 0

2001-12-18 Thread Michael Ackerman
, there is a natural choice for d (e.g., in the integers, the non-negative d; in the ring of polynomials over a field, the monic d (having leading coeff. 1)). In some UFDs there is no canonical choice (e.g. in the Gaussian integers, a + ib for a, b integers). gcd(0, 0) = 0. Cheers, Michael Ackerman

Re: gcd 0 0 = 0

2001-12-18 Thread Jan de Wit
Why not define gcd a b as the largest (in 'normal' order) integer d such that the set of sums of multiples of a and b {na+mb | n - Z, m - Z} is equal to the set of multiples of d {nd | n - Z}? Easy to understand, no talk of division, lattices, rings, ideals etcetera, and it covers the cases with

Re: gcd 0 0 = 0

2001-12-17 Thread Lars Henrik Mathiesen
, and that the quotient identifies x and -x). The only thing that is lacking to make it a lattice on the non-negative integers, is that gcd 0 0 = 0 . All other cases involving zero (i.e., gcd 0 x = x for non-zero x, and lcm 0 x = 0 for all x) are consistent with 0 being the maximal element

Re: gcd 0 0 = 0

2001-12-17 Thread George Russell
I've reconsidered my earlier position and think now that the Prelude is wrong to make gcd 0 0 an error, and should return 0. It probably doesn't make much difference to anyone, but it's like 1 not being a prime; it may be slightly harder to explain, but it makes the maths come out nicer

Re: gcd 0 0 = 0

2001-12-17 Thread Ch. A. Herrmann
George == George Russell [EMAIL PROTECTED] writes: George I've reconsidered my earlier position and think now that the George Prelude is wrong to make gcd 0 0 an error, and should return George 0. It probably doesn't make much difference to anyone, but George it's like 1

Re: gcd 0 0 = 0

2001-12-17 Thread Alan Bawden
, that's a nice way of putting it. How about if the report just says: In order to make the non-negative integers into a lattice under `gcd' and `lcm', we define `gcd 0 0 = 0'. ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman

Re: gcd 0 0 = 0

2001-12-16 Thread Marc van Dongen
Marc van Dongen ([EMAIL PROTECTED]) wrote: : An integer $a$ divides integer $b$ if there exists an integer : $c$ such that $a c= b$. [snip] : gcd 0 0 = 0; and : gcd 0 0 /= error Blah To make clear why $0$ (and not any other non-zero integer) is the gcd of $0$ and $0$ I should have added

Re: gcd 0 0 = 0

2001-12-15 Thread Alan Bawden
From: Simon Peyton-Jones [EMAIL PROTECTED] Date: Fri, 14 Dec 2001 01:18:56 -0800 ... 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

RE: gcd 0 0 = 0

2001-12-14 Thread Simon Peyton-Jones
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 of thing I'm willing to change IF there is a consensus, because it will only make more programs work

Re: gcd 0 0 = 0

2001-12-14 Thread Marc van Dongen
Simon Peyton Jones ([EMAIL PROTECTED]) 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

gcd 0 0 = 0

2001-12-13 Thread S.D.Mechveliani
People write on gcd 0 0 : Alan Bawden [EMAIL PROTECTED] If you take the point-of-view that gcd is actually an operation on ideals, then gcd(0, 0) is 0. I.e. define gcd(x, y) to be the smallest z = 0 such that {m*x + n*y | m, n in Z} = {n*z | n in Z}. This is probably the most natural

Re: gcd 0 0 = 0

2001-12-13 Thread Alan Bawden
From: S.D.Mechveliani [EMAIL PROTECTED] Date: Thu, 13 Dec 2001 12:53:32 +0300 Further, the definintion gcd(x, y) to be the smallest z = 0 such that {m*x + n*y | m, n in Z} = {n*z | n in Z} is not natural. In particular, how does it generalize to gcd X Y for

gcd 0 0

2001-12-11 Thread S.D.Mechveliani
People write about the Report definition of gcd x y as of greatest integer that divides x and y, and mention gcd 0 0 = 0 But 2 also divides 0, because 2*0 = 0. Does the Report specify that gcd 0 0 is not defined? For an occasion

gcd 0 0

2001-12-11 Thread George Russell
S.D.Mechveliani wrote Does the Report specify that gcd 0 0 is not defined? Yes. The Report definition says gcd :: (Integral a) = a - a - a gcd 0 0 = error Prelude.gcd: gcd 0 0 is undefined gcd x y = gcd

Re: gcd 0 0

2001-12-11 Thread Alan Bawden
From: George Russell [EMAIL PROTECTED] Date: Tue, 11 Dec 2001 18:18:31 +0100 ... Yes. The Report definition says gcd :: (Integral a) = a - a - a gcd 0 0 = error Prelude.gcd: gcd 0 0 is undefined gcd x y = gcd' (abs x) (abs y