std::expint,std::expintf,std::expintl (3) - Linux Manuals

std::expint,std::expintf,std::expintl: std::expint,std::expintf,std::expintl


std::expint,std::expintf,std::expintl - std::expint,std::expintf,std::expintl


double expint( double arg );
float expint( float arg );
long double expint( long double arg ); (1) (since C++17)
float expintf( float arg );
long double expintl( long double arg );
double expint( IntegralType arg ); (2) (since C++17)

1) Computes the exponential_integral of arg.
2) A set of overloads or a function template accepting an argument of any integral_type. Equivalent to (1) after casting the argument to double.


arg - value of a floating-point or Integral_type

Return value

If no errors occur, value of the exponential integral of arg, that is -∫∞


dt, is returned.

Error handling

Errors may be reported as specified in math_errhandling

* If the argument is NaN, NaN is returned and domain error is not reported
* If the argument is ±0, -∞ is returned


Implementations that do not support C++17, but support ISO_29124:2010, provide this function if __STDCPP_MATH_SPEC_FUNCS__ is defined by the implementation to a value at least 201003L and if the user defines __STDCPP_WANT_MATH_SPEC_FUNCS__ before including any standard library headers.
Implementations that do not support ISO 29124:2010 but support TR 19768:2007 (TR1), provide this function in the header tr1/cmath and namespace std::tr1
An implementation of this function is also available_in_boost.math


// Run this code

  #include <cmath>
  #include <iostream>
  int main()
      std::cout << "Ei(0) = " << std::expint(0) << '\n'
                << "Ei(1) = " << std::expint(1) << '\n'
                << "Gompetz constant = " << -std::exp(1)*std::expint(-1) << '\n';


  Ei(0) = -inf
  Ei(1) = 1.89512
  Gompetz constant = 0.596347

External links

Weisstein,_Eric_W._"Exponential_Integral." From MathWorld--A Wolfram Web Resource.