E.V.E  0.1-beta

◆ inf

eve::inf = {}
inlineconstexpr

Callable object computing the infinity ieee value.

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

Member Effect
operator() Computes the inf constant

tempate < floating_real_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::inf(as<T>()) is semantically equivalent to T(std::numeric_limits<eve::element_type_t<T>>::infinity())


Example

See it live on Compiler Explorer

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