◆ lcm
Callable object computing least common multiple. Required header: Members Functions
template< value T, value U > auto operator()( T p, U n ) const noexcept requires compatible< T, U >;
Parameters
Return value The result type is the common compatible type of the two parameters.
auto operator[]( conditional_expression auto cond ) const noexcept;
Higher-order function generating a masked version of eve::lcm Parameters
Return value A Callable object so that the expression Supported decoratorsIf the user calls the function with floating parameters, he can enforce the fact that all parameters are flint using one of the roundings decorators on the object function. Namely:
where deco is one of: Type conversionIf the input types are integral, the result is succeptible to overflow, but will never be greater than the product of the two input values which will be representable in the upgraded integral type: The call ExampleSee it live on Compiler Explorer #include <eve/function/lcm.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
using w_t = eve::wide<std::int8_t, eve::fixed<4>>;
w_t pi8 = {93, -25, 32, 37}, qi8 = {42, 10, 27, 102};
using w32_t = eve::wide<std::int32_t, eve::fixed<4>>;
w32_t pi32 = {93, -25, 32, 37}, qi32 = {42, 10, 27, 102};
std::cout << "---- simd" << '\n'
<< " <- pi8 = " << pi8 << '\n'
<< " <- qi8 = " << qi8 << '\n'
std::uint32_t xi = 18, yi = 60;
std::cout << "---- scalar" << '\n'
<< " xi = " << xi << '\n'
<< " yi = " << yi << '\n'
return 0;
}
constexpr callable_lcm_ lcm Callable object computing least common multiple. Definition: lcm.hpp:96 constexpr upgrade_converter const upgrade_ convert a eve::real_value to a eve::real_value of the upgraded base type. Definition: converter.hpp:460 |