gcd

fntypeof(Unqual!(T).init % Unqual!(U).init) gcd(T, U)(T a, U b) if (isIntegral!T && isIntegral!U)

Computes the greatest common divisor of a and b by using an efficient algorithm such as Euclid's or Stein's algorithm.

Parameters

aInteger value of any numerical type that supports the modulo operator `%`. If bit-shifting `<<` and `>>` are also supported, Stein's algorithm will be used; otherwise, Euclid's algorithm is used as _a fallback.
bInteger value of any equivalent numerical type.

Returns

The greatest common divisor of the given arguments.
fnauto gcd(T)(T a, T b) if (!isIntegral!T && is(typeof(T.init % T.init)) && is(typeof(T.init == 0 || T.init > 0)))

ditto