Go to the source code of this file.
|
template<typename T > |
constexpr T | internal::gcd_recur (const T a, const T b) noexcept |
|
template<typename T , typename std::enable_if< std::is_integral< T >::value >::type * = nullptr> |
constexpr T | internal::gcd_int_check (const T a, const T b) noexcept |
|
template<typename T1 , typename T2 , typename TC = common_t<T1,T2>> |
constexpr TC | internal::gcd_type_check (const T1 a, const T2 b) noexcept |
|
template<typename T1 , typename T2 > |
constexpr common_t< T1, T2 > | gcd (const T1 a, const T2 b) noexcept |
| Compile-time greatest common divisor (GCD) function. More...
|
|
◆ gcd()
template<typename T1 , typename T2 >
constexpr common_t< T1, T2 > gcd |
( |
const T1 |
a, |
|
|
const T2 |
b |
|
) |
| |
|
constexprnoexcept |
Compile-time greatest common divisor (GCD) function.
- Parameters
-
a | integral-valued input. |
b | integral-valued input. |
- Returns
- the greatest common divisor between integers
a
and b
using a Euclidean algorithm.