FunctionObjectConcept

AlgebraicStructureTraits::Gcd

Definition

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 R is said to divide b R, iff r R such that a r = b. Thus, 0 is divided by every element of the Ring, in particular by itself.

Refines

AdaptableBinaryFunction

Types

AlgebraicStructureTraits::Gcd::result_type
Is AlgebraicStructureTraits::Type.

AlgebraicStructureTraits::Gcd::first_argument
Is AlgebraicStructureTraits::Type.

AlgebraicStructureTraits::Gcd::second_argument
Is AlgebraicStructureTraits::Type.

Operations

result_type gcd ( first_argument_type x , second_argument_type y )
returns gcd(x,y).

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

See Also

AlgebraicStructureTraits