◆ shr
Callable object computing the arithmetic right 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 right 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::shr Parameters
Return value A Callable object so that the expression Supported decoratorsno decorators are supported ExampleSee it live on Compiler Explorer #include <eve/function/shr.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_shr_ shr Callable object computing the arithmetic right shift operation. Definition: shr.hpp:104 |