◆ ldexp
Callable object computing the ldexp operation: \(\textstyle x 2^n\). Required header: Members Functions
template< floating_value T, integral_real_value U > auto operator()( T x, U n ) const noexcept
requires compatible< T, U >;
Parameters Return value the call auto operator[]( conditional_expression auto cond ) const noexcept;
Higher-order function generating a masked version of eve::ldexp Parameters
Return value A Callable object so that the expression Supported decoratorsno decorators are supported ExampleSee it live on Compiler Explorer #include <eve/function/ldexp.hpp>
#include <eve/wide.hpp>
#include <eve/constant/mindenormal.hpp>
#include <eve/constant/minf.hpp>
#include <eve/constant/inf.hpp>
#include <eve/constant/nan.hpp>
#include <iostream>
using iT = std::int32_t;
using wide_it = eve::wide<iT, eve::fixed<4>>;
using wide_ft = eve::wide<float, eve::fixed<4>>;
int main()
{
wide_it qi = {12, 2, -2, 3 };
wide_ft pf = {1.0f, -1.0f, 0.0f, -2.0f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "<- qi = " << qi << '\n'
float xf = 2, mxf = -2;
iT yi = 3;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "<- mxf = " << mxf << '\n'
<< "<- yi = " << yi << '\n'
return 0;
}
constexpr callable_ldexp_ ldexp Callable object computing the ldexp operation: . Definition: ldexp.hpp:89 |