E.V.E
v2023.02.15

◆ maxflint

eve::maxflint = {}
inlineconstexpr

Computes the the greatest floating point representing an integer and such that n != n+1.

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::value T >
T maxflint(as<T> x) noexcept;
}
constexpr callable_maxflint_ maxflint
Computes the the greatest floating point representing an integer and such that n !...
Definition: maxflint.hpp:59
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>;
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;
return 0;
}
Wrapper for SIMD registers.
Definition: wide.hpp:65