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

◆ valmin

auto eve::valmin = functor<valmin_t>
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template<eve::plain_value T> constexpr T valmin(as<T> x) noexcept;
}
constexpr auto valmin
Computes the the lowest representable value.
Definition valmin.hpp:66
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::valmin(as<T>()) is semantically equivalent to T(std::numeric_limits<element_type_t<T>>::lowest())

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
template<typename T>
consteval auto constexpr_valmin() { return eve::valmin(eve::as<T>{}); }
int main()
{
wide_ft x;
wide_it y;
std::cout << "---- simd" << '\n'
<< "-> valmin(as<wide_ft>() = " << eve::valmin(eve::as<wide_ft>()) << '\n'
<< "-> valmin(as<wide_it>() = " << eve::valmin(eve::as<wide_it>()) << '\n'
<< "-> valmin(as(x)) = " << eve::valmin(eve::as(x)) << '\n'
<< "-> valmin(as(y)) = " << eve::valmin(eve::as(y)) << '\n';
float xf;
std::int64_t xi;
std::cout << "---- scalar" << '\n'
<< "-> valmin(as<float>() = " << eve::valmin(eve::as<float>()) << '\n'
<< "-> valmin(as<std::int16_t>() = " << eve::valmin(eve::as<std::int16_t>()) << '\n'
<< "-> valmin(as(xf)) = " << eve::valmin(eve::as(xf)) << '\n'
<< "-> valmin(as(xi)) = " << eve::valmin(eve::as(xi)) << '\n';
std::cout << "-> constexpr valmin = " << constexpr_valmin<float>() << std::endl;
return 0;
}
Wrapper for SIMD registers.
Definition wide.hpp:86