Talk:Greatest common divisor: Difference between revisions

don't oversimplify
m (→‎errors in programs: claried (I hope) about gcd(0,0)=0 not being MY definition. -- ~~~~)
(don't oversimplify)
Line 10:
:::: I hope I made it clear that it wasn't my definition, but a convention that some people use. I chose the definition ['''gcd(0,0=0'''] that didn't cause a '''SYNTAX''' condition to be raised (in REXX) and cause the program to raise an error condition, or cause it to go into error recovery. The '''GCD''' function is normally only defined for non-zero integers (some define it for only positive integers), it's the case(s) where there're arguments which are zero that are contested. -- [[User:Gerard Schildberger|Gerard Schildberger]] 21:25, 17 August 2012 (UTC)
 
:::: It hurts to read that a divisor (how great or common it may be) should be zero when dividing by zero is among the worst things you can do. As for me, I rather go for undefined! --[[User:Walterpachl|Walterpachl]] 20:47, 17 August 2012 (UTC)
 
dividing by zero is among the worst things you can do. As for me, I rather go for undefined! --[[User:Walterpachl|Walterpachl]] 20:47, 17 August 2012 (UTC)
::::: And, yet, this definition -- where 0 == gcd(0,0) -- is the basis of the original formulation of boolean algebra. It hurts that this bit of history, of math, of logic, of the terminology we use -- is actively being lost to redefinition (and perhaps an unwillingness to think things through).
 
::::: The problem with dividing a number which is not zero, by zero is that you get a zero result when you multiply zero by any number. So, obviously, the issue of dividing zero by zero is different -- here, the problem is not that there's no valid answer. When you divide zero by zero, the problem is that all answers are valid. So, 0 as the answer for 0 == GCD(0,0) has to be valid. It's not the only valid answer, but it's algorithmically simple (we do not need any exceptions in the euclidean algorithm to deal with this case) and it's syntactically simple (it lets GCD be associative).
 
::::: And, this definition corresponds to the definition that Claude Shannon used for for his subset of George Boole's algebra. There are other ways of using algebraic notation with logical values, but I am reminded of this approach every type I use a "boolean value". --[[User:Rdm|Rdm]] 13:12, 18 August 2012 (UTC)
 
-----
 
6,951

edits