◆ bit_width
Callable object computing the bit_width operation. Required header: Members Functions
template< unsigned_value T > auto operator()( T x ) const noexcept;
Parameters
Return value If x is not zero, calculates the number of bits needed to store the value auto operator[]( conditional_expression auto cond ) const noexcept;
Higher-order function generating a masked version of eve::bit_width Parameters
Return value A Callable object so that the expression Supported decoratorsno decorators are supported ExampleSee it live on Compiler Explorer #include <eve/function/bit_width.hpp>
#include <eve/constant/inf.hpp>
#include <eve/wide.hpp>
#include <iostream>
using wide_it = eve::wide<std::uint32_t, eve::fixed<4>>;
int main()
{
wide_it pi = {14, 1, 3, 0};
std::cout << "---- simd" << '\n'
std::uint32_t xf = 48;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
return 0;
}
constexpr callable_bit_width_ bit_width Callable object computing the bit_width operation. Definition: bit_width.hpp:73 |