E.V.E
v2022.03.00

◆ sqrtvalmax

eve::sqrtvalmax = {}
inlineconstexpr

Computes the the greatest value less than the square root of eve::valmax.

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

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::value T >
T sqrtvalmax(as<T> x) noexcept;
}
constexpr callable_sqrtvalmax_ sqrtvalmax
Computes the the greatest value less than the square root of eve::valmax.
Definition: sqrtvalmax.hpp:99
Definition: all_of.hpp:22
Lightweight type-wrapper.
Definition: as.hpp:29

Parameters

  • x : Type wrapper instance embedding the type of the constant.

Return value

The call eve::sqrtvalmax(as<T>()) is the greatest number of the type whose square is less or equal to eve::valmax(as<T>()).

Example

#include <eve/module/core.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;
}
Wrapper for SIMD registers.
Definition: wide.hpp:65

Required header: #include <eve/module/core.hpp>

Member Effect
operator() Computes the sqrtvalmax constant

template < value T > T operator()( as<T> const & t) const noexcept;

Parameters

t: Type wrapper instance embedding the type of the constant.

Return value

the call eve::sqrtvalmax(as<T>()) is the greatest number of the type, the square of which is less or equal to eve::valmax(as<T>()).


Example