
20 Jul
2006
20 Jul
'06
5:29 p.m.
From: "Matthias Hofmann"
Also, I would like to know how the greatest common divisor is defined when one or both of the arguments are zero. In that case, boost::math::gcd() seems to return the nonzero argument, if there is any - but is this mathematically correct?
Yes, it's correct. gcd(a,b) is the greatest integer n such that n|a and n|b. Every integer n has the property that n|0, so gcd(a,0) = a. - James Jones Administrative Data Mgmt. Webmaster 375 Raritan Center Pkwy, Suite A Data Architect Edison, NJ 08837