gcd(0,0)

View: New views
2 Messages — Rating Filter:   Alert me  

gcd(0,0)

by trybulec :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I do not understand problems with divisibility by 0. With the definition
   
      i divides j means ex k st k*i = j

is no problem with saying
   
                0 divides i

in the statement

                 0 divides i implies i = 0

Quite often we suppose that gcd(0,0) is undefined. It is true  with the
high school definition of gcd

          gcd(i,j) divides i &
          gcd(i,j) divides j &
          for k st k divides i & k divides j holds k <= gcd(i,j)

because there is no greatest (wrt <=) natural number.

In lattice theoretic setting the definition is

         gcd(i,j) divides i &
          gcd(i,j) divides j &
          for k st k divides i & k divides j holds k divides gcd(i,j)

and because 0 is the greatest natural number (wrt divides), so gcd(0,0) = 0.

Probably it is nothing new, I would appreciate references.

Best regards,
Andrzej Trybulec

Re: gcd(0,0)

by Robert Boyer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for that!  I've never before understood why in
Common Lisp,

  (gcd 0 0) = 0

> I would appreciate references.

I doubt it is what you were looking for, but here's a
link to what the Common Lisp definition says:

  http://www.lispworks.com/documentation/HyperSpec/Body/f_gcd.htm

That text contains a still obscure-to-me remark that 0
is the identity for the gcd operation.

Bob