E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches

◆ epso_2

eve::epso_2 = functor<epso_2_t>
inlineconstexpr

Defined in Header

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
template< eve::floating_value T >
T epso_2(as<T> x) noexcept;
}
constexpr auto epso_2
Callable object computing the half of the machine epsilon.
Definition: epso_2.hpp:67
EVE Main Namespace.
Definition: abi.hpp:18
Lightweight type-wrapper.
Definition: as.hpp:29

Parameters

  • x : Type wrapper instance embedding the type of the constant.

Return value

The call eve::epso_2(as<T>()) returns the half of the machine epsilon.

Example

#include <eve/module/math.hpp>
#include <eve/wide.hpp>
#include <iostream>
#include <iomanip>
using wide_ft = eve::wide<float>;
template<typename T>
consteval auto constexpr_epso_2() { return eve::epso_2(eve::as<T>{}); }
int main()
{
wide_ft wxf;
std::cout << "---- simd" << std::setprecision(9) << std::endl
<< "-> epso_2(as<wide_ft>()) = " << eve::epso_2(eve::as<wide_ft>()) << std::endl
<< "-> epso_2(as(wxf)) = " << eve::epso_2(eve::as(wxf)) << std::endl;
double xf;
std::cout << "---- scalar" << std::endl
<< "-> epso_2(as<float>()) = " << eve::epso_2(eve::as(float())) << std::endl
<< "-> epso_2(as<xf)) = " << eve::epso_2(eve::as(xf)) << std::endl;
std::cout << "-> constexpr epso_2 = " << constexpr_epso_2<float>() << std::endl;
return 0;
}
Wrapper for SIMD registers.
Definition: wide.hpp:71