E.V.E  0.1-beta

◆ mindenormal

eve::mindenormal = {}
inlineconstexpr

Callable object computing the least denormal positive value.

Required header: #include <eve/function/mindenormal.hpp>

Member Effect
operator() Computes the mindenormal constant

tempate < floating_value T > T operator()( as<T> const & t) const noexcept;
Lightweight type-wrapper.
Definition: as.hpp:29

Parameters

t: Type wrapper instance embedding the type of the constant.

Return value

the call eve::mindenormal(as<T>()) is semantically equivalent to:

  • T(1.4013e-45f) if eve::element_type_t<T> is float
  • T(4.94066e-324) if eve::element_type_t<T> is double

Example

See it live on Compiler Explorer

#include <eve/constant/mindenormal.hpp>
#include <eve/wide.hpp>
#include <iostream>
using wide_ft = eve::wide<float>;
int main()
{
wide_ft wxf;
std::cout << "---- simd" << std::endl
<< "-> mindenormal(as<wide_ft>()) = " << eve::mindenormal(eve::as<wide_ft>()) << std::endl
<< "-> mindenormal(as(wxf)) = " << eve::mindenormal(eve::as(wxf)) << std::endl;
double xf;
std::cout << "---- scalar" << std::endl
<< "-> mindenormal(as<float>()) = " << eve::mindenormal(eve::as(float())) << std::endl
<< "-> mindenormal(as<xf)) = " << eve::mindenormal(eve::as(xf)) << std::endl;
return 0;
}
constexpr callable_mindenormal_ mindenormal
Callable object computing the least denormal positive value.
Definition: mindenormal.hpp:56
Wrapper for SIMD registers.
Definition: wide.hpp:65