E.V.E  0.1-beta

◆ minlog2

eve::minlog2 = {}
inlineconstexpr

Callable object computing the least value for which eve::exp2 returns a non denormal result.

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

Member Effect
operator() Computes the minlog2 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::minlog2(as<T>()) is semantically equivalent to:

  • T(-127.0f) if eve::element_type_t<T> is float
  • T(-1022.0) if eve::element_type_t<T> is double

Example

See it live on Compiler Explorer

#include <eve/constant/minlog2.hpp>
#include <eve/wide.hpp>
#include <iostream>
using wide_ft = eve::wide<float>;
int main()
{
wide_ft wxf;
std::cout << "---- simd" << std::endl
<< "-> minlog2(as<wide_ft>()) = " << eve::minlog2(eve::as<wide_ft>()) << std::endl
<< "-> minlog2(as(wxf)) = " << eve::minlog2(eve::as(wxf)) << std::endl;
double xf;
std::cout << "---- scalar" << std::endl
<< "-> minlog2(as<float>()) = " << eve::minlog2(eve::as(float())) << std::endl
<< "-> minlog2(as<xf)) = " << eve::minlog2(eve::as(xf)) << std::endl;
return 0;
}
constexpr callable_minlog2_ minlog2
Callable object computing the least value for which eve::exp2 returns a non denormal result.
Definition: minlog2.hpp:57
Wrapper for SIMD registers.
Definition: wide.hpp:65