Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/numeric/special functions"

From cppreference.com
< cpp‎ | numeric
(Updated the notes about LWG 3234.)
 
(30 intermediate revisions by 14 users not shown)
Line 1: Line 1:
{{title|Mathematical special functions}}
+
{{title|Mathematical special functions {{mark since c++17}}}}
{{cpp/numeric/special/navbar}}
+
{{cpp/numeric/special_functions/navbar}}
  
 
The Mathematical Special Functions library was originally part of Library TR1 ISO/IEC TR 19768:2007, then published as an independent ISO standard, ISO/IEC 29124:2010, and finally merged to ISO C++ as of C++17.
 
The Mathematical Special Functions library was originally part of Library TR1 ISO/IEC TR 19768:2007, then published as an independent ISO standard, ISO/IEC 29124:2010, and finally merged to ISO C++ as of C++17.
 +
 +
See [[cpp/experimental/special functions|Mathematical special functions]] for the ISO/IEC 29124:2010 version of this library.
  
 
===Functions===
 
===Functions===
 
{{dsc begin}}
 
{{dsc begin}}
 
{{dsc header|cmath}}
 
{{dsc header|cmath}}
{{dsc inc | cpp/numeric/special_math/dsc assoc_laguerre}}
+
{{dsc inc|cpp/numeric/special_functions/dsc assoc_laguerre}}
{{dsc inc | cpp/numeric/special_math/dsc assoc_legendre}}
+
{{dsc inc|cpp/numeric/special_functions/dsc assoc_legendre}}
{{dsc inc | cpp/numeric/special_math/dsc beta}}
+
{{dsc inc|cpp/numeric/special_functions/dsc beta}}
{{dsc inc | cpp/numeric/special_math/dsc comp_ellint_1}}
+
{{dsc inc|cpp/numeric/special_functions/dsc comp_ellint_1}}
{{dsc inc | cpp/numeric/special_math/dsc comp_ellint_2}}
+
{{dsc inc|cpp/numeric/special_functions/dsc comp_ellint_2}}
{{dsc inc | cpp/numeric/special_math/dsc comp_ellint_3}}
+
{{dsc inc|cpp/numeric/special_functions/dsc comp_ellint_3}}
{{dsc inc | cpp/numeric/special_math/dsc cyl_bessel_i}}
+
{{dsc inc|cpp/numeric/special_functions/dsc cyl_bessel_i}}
{{dsc inc | cpp/numeric/special_math/dsc cyl_bessel_j}}
+
{{dsc inc|cpp/numeric/special_functions/dsc cyl_bessel_j}}
{{dsc inc | cpp/numeric/special_math/dsc cyl_bessel_k}}
+
{{dsc inc|cpp/numeric/special_functions/dsc cyl_bessel_k}}
{{dsc inc | cpp/numeric/special_math/dsc cyl_neumann}}
+
{{dsc inc|cpp/numeric/special_functions/dsc cyl_neumann}}
{{dsc inc | cpp/numeric/special_math/dsc ellint_1}}
+
{{dsc inc|cpp/numeric/special_functions/dsc ellint_1}}
{{dsc inc | cpp/numeric/special_math/dsc ellint_2}}
+
{{dsc inc|cpp/numeric/special_functions/dsc ellint_2}}
{{dsc inc | cpp/numeric/special_math/dsc ellint_3}}
+
{{dsc inc|cpp/numeric/special_functions/dsc ellint_3}}
{{dsc inc | cpp/numeric/special_math/dsc expint}}
+
{{dsc inc|cpp/numeric/special_functions/dsc expint}}
{{dsc inc | cpp/numeric/special_math/dsc hermite}}
+
{{dsc inc|cpp/numeric/special_functions/dsc hermite}}
{{dsc inc | cpp/numeric/special_math/dsc legendre}}
+
{{dsc inc|cpp/numeric/special_functions/dsc legendre}}
{{dsc inc | cpp/numeric/special_math/dsc laguerre}}
+
{{dsc inc|cpp/numeric/special_functions/dsc laguerre}}
{{dsc inc | cpp/numeric/special_math/dsc riemann_zeta}}
+
{{dsc inc|cpp/numeric/special_functions/dsc riemann_zeta}}
{{dsc inc | cpp/numeric/special_math/dsc sph_bessel}}
+
{{dsc inc|cpp/numeric/special_functions/dsc sph_bessel}}
{{dsc inc | cpp/numeric/special_math/dsc sph_legendre}}
+
{{dsc inc|cpp/numeric/special_functions/dsc sph_legendre}}
{{dsc inc | cpp/numeric/special_math/dsc sph_neumann}}
+
{{dsc inc|cpp/numeric/special_functions/dsc sph_neumann}}
 
{{dsc end}}
 
{{dsc end}}
  
===See also===
+
===Notes===
{{dsc begin}}
+
The {{c/core|float}} and {{c/core|long double}} overloads for math special functions without the "{{tt|f}}" or "{{tt|l}}" suffix are present in the final draft of ISO/IEC 29124:2010 ({{wg21|N3060}}), but absent in the published C++17/20 standard (see {{lwg|3234}}). These overloads were not provided by MSVC STL until VS 2022 17.3.
{{dsc see c | c/numeric/special | Special mathematical functions}}
+
 
{{dsc end}}
+
These functions are unrelated to [[cpp/language/member functions#Special member functions|special member functions]] of class types.
 +
 
 +
{{feature test macro|__cpp_lib_math_special_functions|std=C++17|value=201603L|[[#Top|Mathematical special functions]]}}
 +
 
 +
===Defect reports===
 +
{{dr list begin}}
 +
{{dr list item|wg=lwg|dr=3234|paper=P1467R9|std=C++17|before=additional overloads for math special functions were missing|after=these overloads are required}}
 +
{{dr list end}}
 +
 
 +
===References===
 +
{{ref std c++23}}
 +
{{ref std|section=28.7.6|title=Mathematical special functions|id=sf.cmath}}
 +
{{ref std end}}
 +
{{ref std c++20}}
 +
{{ref std|section=26.8.6|title=Mathematical special functions|id=sf.cmath}}
 +
{{ref std end}}
 +
{{ref std c++17}}
 +
{{ref std|section=29.9.5|title=Mathematical special functions|id=sf.cmath}}
 +
{{ref std end}}
 +
 
 +
{{langlinks|es|ja|ru|zh}}

Latest revision as of 00:33, 21 March 2023

 
 
 
 

The Mathematical Special Functions library was originally part of Library TR1 ISO/IEC TR 19768:2007, then published as an independent ISO standard, ISO/IEC 29124:2010, and finally merged to ISO C++ as of C++17.

See Mathematical special functions for the ISO/IEC 29124:2010 version of this library.

Contents

[edit] Functions

Defined in header <cmath>
associated Laguerre polynomials
(function) [edit]
associated Legendre polynomials
(function) [edit]
(C++17)(C++17)(C++17)
beta function
(function) [edit]
(complete) elliptic integral of the first kind
(function) [edit]
(complete) elliptic integral of the second kind
(function) [edit]
(complete) elliptic integral of the third kind
(function) [edit]
regular modified cylindrical Bessel functions
(function) [edit]
cylindrical Bessel functions (of the first kind)
(function) [edit]
irregular modified cylindrical Bessel functions
(function) [edit]
cylindrical Neumann functions
(function) [edit]
(C++17)(C++17)(C++17)
(incomplete) elliptic integral of the first kind
(function) [edit]
(C++17)(C++17)(C++17)
(incomplete) elliptic integral of the second kind
(function) [edit]
(C++17)(C++17)(C++17)
(incomplete) elliptic integral of the third kind
(function) [edit]
(C++17)(C++17)(C++17)
exponential integral
(function) [edit]
(C++17)(C++17)(C++17)
Hermite polynomials
(function) [edit]
(C++17)(C++17)(C++17)
Legendre polynomials
(function) [edit]
(C++17)(C++17)(C++17)
Laguerre polynomials
(function) [edit]
Riemann zeta function
(function) [edit]
spherical Bessel functions (of the first kind)
(function) [edit]
spherical associated Legendre functions
(function) [edit]
spherical Neumann functions
(function) [edit]

[edit] Notes

The float and long double overloads for math special functions without the "f" or "l" suffix are present in the final draft of ISO/IEC 29124:2010 (N3060), but absent in the published C++17/20 standard (see LWG issue 3234). These overloads were not provided by MSVC STL until VS 2022 17.3.

These functions are unrelated to special member functions of class types.

Feature-test macro Value Std Feature
__cpp_lib_math_special_functions 201603L (C++17) Mathematical special functions

[edit] Defect reports

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

DR Applied to Behavior as published Correct behavior
LWG 3234
(P1467R9)
C++17 additional overloads for math special functions were missing these overloads are required

[edit] References

  • C++23 standard (ISO/IEC 14882:2024):
  • 28.7.6 Mathematical special functions [sf.cmath]
  • C++20 standard (ISO/IEC 14882:2020):
  • 26.8.6 Mathematical special functions [sf.cmath]
  • C++17 standard (ISO/IEC 14882:2017):
  • 29.9.5 Mathematical special functions [sf.cmath]