E.V.E  0.1-beta

◆ valmax

eve::valmax = {}
inlineconstexpr

Callable object computing the greatest representable value.

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

Member Effect
operator() Computes the valmax constant

tempate < 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::valmax(as<T>()) is semantically equivalent to T(std::numeric_limits<element_type_t<T>>max())


Example

See it live on Compiler Explorer

#include <eve/function/abs.hpp>
#include <eve/constant/valmax.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft x;
wide_it y;
std::cout << "---- simd" << '\n'
<< "-> valmax(as<wide_ft>() = " << eve::valmax(eve::as<wide_ft>()) << '\n'
<< "-> valmax(as<wide_it>() = " << eve::valmax(eve::as<wide_it>()) << '\n'
<< "-> valmax(as(x)) = " << eve::valmax(eve::as(x)) << '\n'
<< "-> valmax(as(y)) = " << eve::valmax(eve::as(y)) << '\n';
float xf;
std::int16_t xi;
std::cout << "---- scalar" << '\n'
<< "-> valmax(as<float>() = " << eve::valmax(eve::as<float>()) << '\n'
<< "-> valmax(as<std::int16_t>() = " << eve::valmax(eve::as<std::int16_t>()) << '\n'
<< "-> valmax(as(xf)) = " << eve::valmax(eve::as(xf)) << '\n'
<< "-> valmax(as(xi)) = " << eve::valmax(eve::as(xi)) << '\n';
return 0;
}
constexpr callable_valmax_ valmax
Callable object computing the greatest representable value.
Definition: valmax.hpp:53
Wrapper for SIMD registers.
Definition: wide.hpp:65