Re: math:gcd is incorrect
- Posted by bill May 07, 2012
- 1924 views
Note: formally gcd(0, 0) is undefined and should be an
error just as much as division by zero is an error.
Technically, this is correct. Sometimes GCD(0, 0) is
explicitly considered being equal to zero for similar
reasons that 0^0 is considered equal to 1.
The situations are not similar.
1. 0^0 is def = 1 because lim x->0 x^x = 1 and x^x is continuous on all real x != 0 2. GCD is a divisor: by definition 0 is not a divisor 3. Normalisation: Q(0,0) = 0: Q(x,y) = (x/gcd(x,y), y/gcd(x,y))

