◆ exponentbits()

as_integer_t<IEEEValue> boost::simd::exponentbits ( IEEEValue const &  x)

This function object returns the exponent bits of its arguments as an integer value, the other bits (sign and mantissa) being just masked.

Header <boost/simd/function/exponentbits.hpp>
Example:
#include <boost/simd/ieee.hpp>
#include <boost/simd/pack.hpp>
#include <iostream>
namespace bs = boost::simd;
using pack_ft = bs::pack <float, 4>;
int main()
{
pack_ft pf = {1.0f, 2.0f, -1.0f, 0.5f};
std::cout
<< "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> bs::exponentbits(pf) = " << bs::exponentbits(pf) << '\n';
float xf = 2.0f;
std::cout
<< "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> bs::exponentbits(xf) = " << bs::exponentbits(xf) << '\n';
return 0;
}
Possible output:
---- simd
<- pf = (1, 2, -1, 0.5)
-> bs::exponentbits(pf) = (1065353216, 1073741824, 1065353216, 1056964608)
---- scalar
<- xf = 2
-> bs::exponentbits(xf) = 1073741824