[Haskell-cafe] Re: gcd
joao at joaoff.com
Sun May 3 14:49:24 EDT 2009
Something that perhaps could be added is that leaving 0 `gcd` 0 undefined
has two obvious annoying consequences: gcd is no longer idempotent (i.e. we
don't have a `gcd` a = a, for all a), and it is no longer associative ((a
`gcd` 0) `gcd` 0 is well-defined whilst a `gcd` (0 `gcd` 0) is not).
(We actually wrote something about this on a recent paper. If you're
interested, see http://www.joaoff.com/publications/2009/euclid-alg )
2009/5/3 Nathan Bloomfield <nbloomf at gmail.com>
> > This, to defend myself, was not how it was explained in high school.
> No worries. I didn't realize this myself until college; most nonspecialist
> teachers just don't know any better. Nor did, it appears, the original
> authors of the Haskell Prelude. :)
> BTW, this definition of gcd makes it possible to consider gcds in rings
> that otherwise have no natural order- such as rings of polynomials in
> several variables, group rings, et cetera.
> Nathan Bloomfield
> On Sun, May 3, 2009 at 11:16 AM, Achim Schneider <barsoap at web.de> wrote:
>> Nathan Bloomfield <nbloomf at gmail.com> wrote:
>> > The "greatest" in gcd is not w.r.t. the canonical ordering on the
>> > naturals; rather w.r.t. the partial order given by the divides
>> > relation.
>> This, to defend myself, was not how it was explained in high school.
>> (c) this sig last receiving data processing entity. Inspect headers
>> for copyright history. All rights reserved. Copying, hiring, renting,
>> performance and/or quoting of this signature prohibited.
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe