◆ shl
Callable object computing the arithmetic left shift operation. Required header: Members Functions
template< value T, integral_real_value U > auto operator()( T x, U n ) const noexcept
requires bit_compatible< T, U >;
Parameters
Return value Computes the elementwise arithmetic left shift of the first parameter by the second one. the call The types must share the same cardinal or be scalar and if
auto operator[]( conditional_expression auto cond ) const noexcept;
Higher-order function generating a masked version of eve::shl Parameters
Return value A Callable object so that the expression Supported decoratorsno decorators are supported ExampleSee it live on Compiler Explorer #include <eve/function/shl.hpp>
#include <eve/wide.hpp>
#include <iostream>
using iT = std::int32_t;
using wide_it = eve::wide<iT, eve::fixed<4>>;
int main()
{
wide_it pi = {100, 200, -2, 3};
wide_it qi = {1, 2, 3, 2};
std::cout << "---- simd" << '\n'
<< "<- qi = " << qi << '\n'
iT xi = 2, mxi = -2, yi = 3;
std::cout << "---- scalar" << '\n'
<< "<- xi = " << xi << '\n'
<< "<- mxi = " << mxi << '\n'
<< "<- yi = " << yi << '\n'
return 0;
}
constexpr callable_shl_ shl Callable object computing the arithmetic left shift operation. Definition: shl.hpp:105 |