25 Algorithms library [algorithms]

25.10 Generalized numeric operations [numeric.ops]

25.10.13 Greatest common divisor [numeric.ops.gcd]

template<class M, class N> constexpr common_type_t<M,N> gcd(M m, N n);
Mandates: M and N both are integer types and not cv bool.
Preconditions: |m| and |n| are representable as a value of common_­type_­t<M, N>.
Note
:
These requirements ensure, for example, that is representable as a value of type M.
— end note
 ]
Returns: Zero when m and n are both zero.
Otherwise, returns the greatest common divisor of |m| and |n|.
Throws: Nothing.