std::expint...std::expintl(3)
π NAME π
okay bestie, welcome to the std::expint...std::expintl(3) page from the C++ Standard Libary β yes, that exact manual name, and we're talking about std::expint, std::expintf, and std::expintl π«Ά
The name line is literally std::expint,std::expintf,std::expintl β and then it says std::expint,std::expintf,std::expintl again. iconic repetition, no notes π
π¦ Synopsis π¦
Here's the signature lineup, copied exactly because we do not play with function signatures:
double expint( double arg );
double expint( float arg );
double expint( long double arg ); (1)
float expintf( float arg );
long double expintl( long double arg );
double expint( IntegralType arg ); (2)
- Computes the exponential integral of
arg. - A set of overloads or a function template accepting an argument of any integral type. Equivalent to (1) after casting the argument to
double.
and because this is a special function, there's a whole availability vibe check: as all special functions,expintis only guaranteed to be available in<cmath>if__STDCPP_MATH_SPEC_FUNCS__is defined by the implementation to a value at least201003Land if the user defines__STDCPP_WANT_MATH_SPEC_FUNCS__before including any standard library headers. periodt.
π Parameters π
argβ value of a floating-point orIntegraltype.
π Return value π
If no errors occur, the value of the exponential integral of arg, that is:
-β«β
-arg
e^-t
t
dt
is returned. slay π
π Error handling π
Errors may be reported as specified in math_errhandling. The specific mood:
- If the argument is
NaN,NaNis returned and domain error is not reported. - If the argument is
Β±0,-βis returned.
π§ Notes π§
- Implementations that do not support TR 29124 but support TR 19768 provide this function in the header
tr1/cmathand namespacestd::tr1. - An implementation of this function is also available in
boost.math.
πΈ Example πΈ
(works as shown with gcc 6.0)
// Run this code
#define __STDCPP_WANT_MATH_SPEC_FUNCS__ 1
#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';
}
π» Output π»
Ei(0) = -inf
Ei(1) = 1.89512
Gompetz constant = 0.596347
π External links π
Weisstein, Eric W. "Exponential Integral." From MathWorld--A Wolfram Web Resource.
mwah π β source/version: http://cppreference.com; date: 2024.06.10; manual: std::expint...std::expintl(3). bye bestie, go compute that exponential integral β¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms