◆ hi()

as_integer_t<Value, unsigned> boost::simd::hi ( Value const &  x)

This function object returns the high part of the entry as an unsigned integer of the size of the input.

Header <boost/simd/function/hi.hpp>
See also
lo
Example:
#include <boost/simd/bitwise.hpp>
#include <boost/simd/pack.hpp>
#include <iostream>
namespace bs = boost::simd;
using iT = std::int32_t;
using pack_it = bs::pack<iT, 4>;
int main() {
pack_it pi = {1, 2, -1, 32769};
std::cout << "---- simd" << '\n'
<< "<- pi = " << pi << '\n'
<< "-> bs::hi(pi) = " << bs::hi(pi) << '\n';
iT xi = 2;
std::cout << "---- scalar" << '\n'
<< "<- xi = " << xi << '\n'
<< "-> bs::hi(xi) = " << bs::hi(xi) << '\n';
return 0;
}
Possible output:
---- simd
<- pi = (1, 2, -1, 32769)
-> bs::hi(pi) = (0, 0, 65535, 0)
---- scalar
<- xi = 2
-> bs::hi(xi) = 0