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

◆ maxexponentp1

auto eve::maxexponentp1 = functor<maxexponentp1_t>
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template<eve::floating_value T> constexpr eve::as_integer<T> maxexponentp1(as<T> x);
}
constexpr auto maxexponentp1
Computes the the greatest exponent of a floating point IEEE value plus one.
Definition maxexponentp1.hpp:70
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::maxexponentp1(as<T>()) is semantically equivalent to

  • as_integer_t<T>(128) if eve::element_type_t<T> is float
  • as_integer_t<T>(1024) if eve::element_type_t<T> is double

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
using wide_ft = eve::wide<float>;
template<typename T>
consteval auto constexpr_maxexponentp1() { return eve::maxexponentp1(eve::as<T>{}); }
int main()
{
wide_ft wxf;
std::cout << "---- simd" << std::endl
<< "-> maxexponentp1(as<wide_ft>()) = " << eve::maxexponentp1(eve::as<wide_ft>()) << std::endl
<< "-> maxexponentp1(as(wxf)) = " << eve::maxexponentp1(eve::as(wxf)) << std::endl;
double xf;
std::cout << "---- scalar" << std::endl
<< "-> maxexponentp1(as<float>()) = " << eve::maxexponentp1(eve::as(float())) << std::endl
<< "-> maxexponentp1(as<xf)) = " << eve::maxexponentp1(eve::as(xf)) << std::endl;
std::cout << "-> constexpr maxexponentp1 = " << constexpr_maxexponentp1<float>() << std::endl;
return 0;
}
Wrapper for SIMD registers.
Definition wide.hpp:86