Implementation of piranha::math::gcd() for integral types.
More...
#include <piranha/math.hpp>
|
using | p_type = decltype(std::declval< const T & >()+std::declval< const U & >()) |
| The promoted type of T and U.
|
|
template<typename T, typename U>
struct piranha::math::gcd_impl< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
Implementation of piranha::math::gcd() for integral types.
This specialisation is enabled when T
and U
are C++ integral types.
Definition at line 2845 of file math.hpp.
◆ operator()()
template<typename T , typename U >
p_type piranha::math::gcd_impl< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >::operator() |
( |
const T & |
a, |
|
|
const U & |
b |
|
) |
| const |
|
inline |
Call operator.
The GCD will be computed via the euclidean algorithm. No overflow check is performed during the computation.
- Parameters
-
a | the first operand. |
b | the second operand. |
- Returns
- the GCD of
a
and b
.
Definition at line 2858 of file math.hpp.
The documentation for this struct was generated from the following file: