Computes the greatest common divisor of the inputs.
{
template< eve::real_value T, eve::real_value U >
T
gcd(T p, U n)
noexcept;
}
constexpr callable_gcd_ gcd
Computes the greatest common divisor of the inputs.
Definition: gcd.hpp:61
Definition: all_of.hpp:22
If both p and n are zero, returns zero. Otherwise, returns the greatest common divisor of |p| and |n|.
#include <eve/module/combinatorial.hpp>
#include <eve/wide.hpp>
#include <iostream>
int
main()
{
w_t
pi = {93, 25, 32, 368}, qi = {42, 30, 27, 1024};
std::cout << "---- simd" << '\n'
<<
" <- pi = " <<
pi <<
'\n'
<< " <- qi = " << qi << '\n'
<<
" -> gcd(pi, qi) = " <<
eve::gcd(
pi, qi) <<
'\n';
std::uint32_t xi = 18, yi = 60;
std::cout << "---- scalar" << '\n'
<< " xi = " << xi << '\n'
<< " yi = " << yi << '\n'
<<
" -> gcd(xi, yi) = " <<
eve::gcd(xi, yi) <<
'\n';
return 0;
}
constexpr callable_pi_ pi
Callable object computing the constant .
Definition: pi.hpp:49
Wrapper for SIMD registers.
Definition: wide.hpp:65