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

◆ minexponent

auto eve::minexponent = functor<minexponent_t>
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

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

  • as_integer_t<T>(-126) if eve::element_type_t<T> is float
  • as_integer_t<T>(-1022) 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_minexponent() { return eve::minexponent(eve::as<T>{}); }
int main()
{
wide_ft wxf;
std::cout << "---- simd" << std::endl
<< "-> minexponent(as<wide_ft>()) = " << eve::minexponent(eve::as<wide_ft>()) << std::endl
<< "-> minexponent(as(wxf)) = " << eve::minexponent(eve::as(wxf)) << std::endl;
double xf;
std::cout << "---- scalar" << std::endl
<< "-> minexponent(as<float>()) = " << eve::minexponent(eve::as(float())) << std::endl
<< "-> minexponent(as<xf)) = " << eve::minexponent(eve::as(xf)) << std::endl;
std::cout << "-> constexpr minexponent = " << constexpr_minexponent<float>() << std::endl;
return 0;
}
Wrapper for SIMD registers.
Definition wide.hpp:70