E.V.E
v2023.02.15

◆ egamma

eve::egamma = {}
inlineconstexpr

Callable object computing the Euler-Mascheroni constant : \(\gamma = \lim_{n\to\infty}\left( \sum_{k = 0}^n \frac1k - \log n\right )\).

Defined in Header

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
template< eve::value T >
T egamma(as<T> x) noexcept;
}
constexpr callable_egamma_ egamma
Callable object computing the Euler-Mascheroni constant : .
Definition: egamma.hpp:51
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::egamma(as<T>()) returns \(\gamma = \lim_{n\to\infty}\left( \sum_{k = 0}^n \frac1k - \log n\right )\).

Example

#include <eve/module/math.hpp>
#include <eve/wide.hpp>
#include <iostream>
#include <iomanip>
using wide_ft = eve::wide<float>;
int main()
{
wide_ft wxf;
std::cout << "---- simd" << std::setprecision(9) << std::endl
<< "-> egamma(as<wide_ft>()) = " << eve::egamma(eve::as<wide_ft>()) << std::endl
<< "-> egamma(as(wxf)) = " << eve::egamma(eve::as(wxf)) << std::endl;
double xf;
std::cout << "---- scalar" << std::endl
<< "-> egamma(as<float>()) = " << eve::egamma(eve::as(float())) << std::endl
<< "-> egamma(as<xf)) = " << eve::egamma(eve::as(xf)) << std::endl;
return 0;
}
Wrapper for SIMD registers.
Definition: wide.hpp:65