gcd0
Gcd0 is a term used in some mathematical and computational contexts to denote a conventionally extended greatest common divisor function that assigns a value for all integer pairs, including the case (0,0). It behaves like the ordinary greatest common divisor for nonzero pairs and provides a definite value when one or both arguments are zero.
Definition. Gcd0 maps Z × Z to Z and is defined by: gcd0(a,b) = gcd(|a|,|b|) for any pair
Properties. Gcd0 is symmetric: gcd0(a,b) = gcd0(b,a). It agrees with the usual positive gcd for all nonzero
Relation to standard gcd and lcm. For any pair not both zero, gcd0(a,b) equals the conventional gcd
Examples. gcd0(18,24) = 6; gcd0(0,12) = 12; gcd0(0,0) = 0. In many programming libraries, the implemented gcd function matches