CGAL 5.1 - Algebraic Foundations
AlgebraicStructureTraits_::Gcd Concept Reference


AdaptableBinaryFunction providing the gcd.

The greatest common divisor ( \( gcd\)) of ring elements \( x\) and \( y\) is the unique ring element \( d\) (up to a unit) with the property that any common divisor of \( x\) and \( y\) also divides \( d\). (In other words: \( d\) is the greatest lower bound of \( x\) and \( y\) in the partial order of divisibility.) We demand the \( gcd\) to be unit-normal (i.e. have unit part 1).

\( gcd(0,0)\) is defined as \( 0\), since \( 0\) is the greatest element with respect to the partial order of divisibility. This is because an element \( a \in R\) is said to divide \( b \in R\), iff \( \exists r \in R\) such that \( a \cdot r = b\). Thus, \( 0\) is divided by every element of the Ring, in particular by itself.

See also


typedef unspecified_type result_type
 Is AlgebraicStructureTraits::Type.
typedef unspecified_type first_argument
 Is AlgebraicStructureTraits::Type.
typedef unspecified_type second_argument
 Is AlgebraicStructureTraits::Type.


result_type operator() (first_argument_type x, second_argument_type y)
 returns \( gcd(x,y)\).
template<class NT1 , class NT2 >
result_type operator() (NT1 x, NT2 y)
 This operator is defined if NT1 and NT2 are ExplicitInteroperable with coercion type AlgebraicStructureTraits::Type.