Boost logo

Boost Users :

From: james.jones_at_[hidden]
Date: 2006-07-20 13:29:31


From: "Matthias Hofmann" <hofmann_at_[hidden]>
> 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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net