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

◆ maxflint

auto eve::maxflint = functor<maxflint_t>
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template<eve::floating_value T> constexpr T maxflint(as<T> x) noexcept;
}
constexpr auto maxflint
Computes the the greatest floating point representing an integer and such that n !...
Definition maxflint.hpp:69
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::maxflint(as<T>()) is semantically equivalent to:

  • T(16777216.0f) if eve::element_type_t<T> is float.
  • T(9007199254740992.0) if eve::element_type_t<T> is double.

Example

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