gcd#
Fully qualified name: carb::cpp::gcd
Defined in carb/cpp/Numeric.h
-
template<class M, class N>
inline constexpr std::common_type_t<M, N> carb::cpp::gcd(
) noexcept# Computes the greatest common divisor of two integers.
If either
MorNis not an integer type, or if either is (possibly cv-qualified)bool, the program is ill- formed. If either|m|or|n|is not representable as a value of typestd::common_type_t<M, N>, the behavior is undefined.- Parameters:
m – Integer value
n – Integer value
- Returns:
If both
mandnare 0, returns 0; otherwise returns the greatest common divisor of|m|and|n|.