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

◆ maxexponent

auto eve::maxexponent = functor<maxexponent_t>
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

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

  • as_integer_t<T>(127) if eve::element_type_t<T> is float
  • as_integer_t<T>(1023) 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_maxexponent() { return eve::maxexponent(eve::as<T>{}); }
int main()
{
wide_ft wxf;
std::cout << "---- simd" << std::endl
<< "-> maxexponent(as<wide_ft>()) = " << eve::maxexponent(eve::as<wide_ft>()) << std::endl
<< "-> maxexponent(as(wxf)) = " << eve::maxexponent(eve::as(wxf)) << std::endl;
double xf;
std::cout << "---- scalar" << std::endl
<< "-> maxexponent(as<float>()) = " << eve::maxexponent(eve::as(float())) << std::endl
<< "-> maxexponent(as<xf)) = " << eve::maxexponent(eve::as(xf)) << std::endl;
std::cout << "-> constexpr maxexponent = " << constexpr_maxexponent<float>() << std::endl;
return 0;
}
Wrapper for SIMD registers.
Definition wide.hpp:86