Skip to content

gcd

gcd<T>(a, b, domain): T

Defined in: gcd.ts:17

Greatest common divisor in an arbitrary Euclidean domain, computed by the Euclidean algorithm: gcd(a, b) = gcd(b, a mod b) until the remainder is zero.

The result is a generator of the ideal (a) + (b); it is unique only up to multiplication by a unit of the domain.

T

The carrier set of the domain.

T

First operand.

T

Second operand.

EuclideanDomain<T>

Evidence that T admits division with remainder.

T

A greatest common divisor of a and b.