◆ modf
Callable object computing the modf operation. Required header: Members Functions
Definition: value.hpp:31 Parameters
Return value A pair of values containing respectively the elementwise fractional and integral parts of In particular:
Supported decorators
ExampleSee it live on Compiler Explorer #include <eve/function/modf.hpp>
#include <eve/function/pedantic/modf.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<float, eve::fixed<8>>;
int main()
{
wide_ft pf = {-0.0, 1.30f, -1.3f, eve::inf(eve::as<float>()), 0.0f,
eve::nan(eve::as<float>()), 0.678f, -0.678f};
auto [m, e] = eve::modf(pf);
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> modf(pf) = [" << '\n'
<< " " << m << ", \n"
<< " " << e << '\n'
<< " ]\n"
<< "-> pedantic(modf)(pf) = [" << '\n'
<< " " << mp << ", \n"
<< " " << ep << '\n'
<< " ]\n";
float xf = 2.3;
auto [sm, se] = eve::modf(xf);
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> modf(xf) = [" << sm << ", " << se << "]\n";
return 0;
}
constexpr callable_modf_ modf Callable object computing the modf operation. Definition: modf.hpp:68 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 |