std::comp_e...p_ellint_2l(3)
β¨ NAME β¨
std::comp_ellint_2,std::comp_ellint_2f,std::comp_ellint_2l β std::comp_ellint_2,std::comp_ellint_2f,std::comp_ellint_2l
Okay bestie, welcome to the C++ Standard Libary manualβs page for the std::comp_ellint_2 trio π β the page handle is std::comp_e...p_ellint_2l(3), and weβre about to get into some complete elliptic integral of the second kind energy. Slay.
π¦ Synopsis π¦
double comp_ellint_2( double arg );
double comp_ellint_2( float arg );
double comp_ellint_2( long double arg ); (1)
float comp_ellint_2f( float arg );
long double comp_ellint_2l( long double arg );
double comp_ellint_2( IntegralType arg ); (2)
- This one computes the complete elliptic integral of the second kind of
arg, periodt. - This is a set of overloads or a function template accepting an argument of any integral type. Itβs equivalent to (1) after casting the argument to
double.
And listen, bestie β as with all special functions, comp_ellint_2 is only guaranteed to be available in <cmath> 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. Iyk what I mean π
π Parameters π
argβ value of a floating-point or integral type. Thatβs the whole vibe check for this parameter, no cap.
π Return value π
If no errors occur, you get the value of the complete elliptic integral of the second kind of arg β that is, ellint_2(arg, Ο/2) β returned to you like a little math gift π
π Error handling π
Errors may be reported as specified in math_errhandling. Keep that in mind, bestie, because math does have rules even when itβs being iconic.
- If the argument is
NaN,NaNis returned and domain error is not reported. - If
|arg| > 1, a domain error may occur. So yeah, watch out for that π«Ά
π Notes π
Implementations that do not support TR 29124 but support TR 19768 provide this function in the header tr1/cmath and namespace std::tr1. Cute, right? An implementation of this function is also available in boost.math. Obsessed with the options π
β¨ Example β¨
This works as shown with gcc 6.0 β literally, thatβs the note, bestie:
// Run this code
#define __STDCPP_WANT_MATH_SPEC_FUNCS__ 1
#include <cmath>
#include <iostream>
int main()
{
double hpi = std::acos(-1) / 2;
std::cout << "E(0) = " << std::comp_ellint_2(0) << '\n'
<< "Ο/2 = " << hpi << '\n'
<< "E(0.5) = " << std::comp_ellint_2(0.5) << '\n'
<< "E(0.5, Ο/2) = " << std::ellint_2(0.5, hpi) << '\n';
}
π Output π
E(0) = 1.5708
Ο/2 = 1.5708
E(0.5) = 1.46746
E(0.5, Ο/2) = 1.46746
π§ External links π§
Weisstein, Eric W. "Complete Elliptic Integral of the Second Kind." From MathWorld--A Wolfram Web Resource.
π See also π
ellint_2β (incomplete) elliptic integral of the second kindellint_2fβ (function)ellint_2l
And thatβs the page, bestie π
β¨ This little masterpiece came from http://cppreference.com, dated 2024.06.10, with the footer handle std::comp_e...p_ellint_2l(3). Byeeee π«ΆπΈ
π¦ 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