E.V.E  0.1-beta

◆ sqrtvalmax

eve::sqrtvalmax = {}
inlineconstexpr

Callable object computing the greatest value less than the square root of the greatest value.

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

Member Effect
operator() Computes the sqrtvalmax 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::sqrtvalmax(as<T>()) is semantically equivalent to T(floor(sqrt(eve::valmax(as<T>())))


Example

See it live on Compiler Explorer

#include <eve/constant/sqrtvalmax.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft x;
wide_it y;
std::cout << "---- simd" << '\n'
<< "-> sqrtvalmax(as<wide_ft>() = " << eve::sqrtvalmax(eve::as<wide_ft>()) << '\n'
<< "-> sqrtvalmax(as<wide_it>() = " << eve::sqrtvalmax(eve::as<wide_it>()) << '\n'
<< "-> sqrtvalmax(as(x)) = " << eve::sqrtvalmax(eve::as(x)) << '\n'
<< "-> sqrtvalmax(as(y)) = " << eve::sqrtvalmax(eve::as(y)) << '\n';
float xf;
std::int16_t xi;
std::cout << "---- scalar" << '\n'
<< "-> sqrtvalmax(as<float>() = " << eve::sqrtvalmax(eve::as<float>()) << '\n'
<< "-> sqrtvalmax(as<std::int16_t>() = " << eve::sqrtvalmax(eve::as<std::int16_t>()) << '\n'
<< "-> sqrtvalmax(as(xf)) = " << eve::sqrtvalmax(eve::as(xf)) << '\n'
<< "-> sqrtvalmax(as(xi)) = " << eve::sqrtvalmax(eve::as(xi)) << '\n';
return 0;
}
constexpr callable_sqrtvalmax_ sqrtvalmax
Callable object computing the greatest value less than the square root of the greatest value.
Definition: sqrtvalmax.hpp:56
Wrapper for SIMD registers.
Definition: wide.hpp:65