◆ frexp
Callable object computing the frexp pair of values. Required header: Members Functions
Definition: value.hpp:83 Parameters Return value Computes the elementwise ieee frexp of the floating value, returning a pair {m,e} of values of the same type of However, the cases \(x = \pm\infty\) or is a Nan or a denormal are undefined. Supported decorators
ExampleSee it live on Compiler Explorer #include <eve/function/frexp.hpp>
#include <eve/function/pedantic/frexp.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 wide_ft = eve::wide<double, eve::fixed<8>>;
int main()
{
wide_ft pf = {-1.0f, 0.0f, 367.0f, -1005600.0f, eve::mindenormal(eve::as<double>()),
auto [m, e] = eve::frexp(pf);
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> frexp(pf) = [" << '\n'
<< " " << m << ", \n"
<< " " << e << '\n'
<< " ]\n"
<< "-> pedantic(frexp)(pf) = [" << '\n'
<< " " << mp << ", \n"
<< " " << ep << '\n'
<< " ]\n";
float xf = 2.3;
auto [sm, se] = eve::frexp(xf);
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> frexp(xf) = [" << sm << ", " << se << "]\n";
return 0;
}
constexpr callable_minf_ minf Callable object computing the negative infinity value. Definition: minf.hpp:55 constexpr callable_mindenormal_ mindenormal Callable object computing the least denormal positive value. Definition: mindenormal.hpp:56 constexpr callable_inf_ inf Callable object computing the infinity ieee value. Definition: inf.hpp:54 constexpr pedantic_type const pedantic Higher-order Callable Object imbuing more standard semantic onto other Callable Objects. Definition: pedantic.hpp:56 constexpr callable_frexp_ frexp Callable object computing the frexp pair of values. Definition: frexp.hpp:66 |