[numbers] # 29 Numerics library [[numerics]](./#numerics) ## 29.8 Numbers [numbers] ### [29.8.1](#syn) Header synopsis [[numbers.syn]](numbers.syn) [🔗](#header:%3cnumbers%3e) namespace std::numbers {template constexpr T [e_v](#lib:e_v "29.8.1 Header synopsis [numbers.syn]") = *unspecified*; template constexpr T [log2e_v](#lib:log2e_v "29.8.1 Header synopsis [numbers.syn]") = *unspecified*; template constexpr T [log10e_v](#lib:log10e_v "29.8.1 Header synopsis [numbers.syn]") = *unspecified*; template constexpr T [pi_v](#lib:pi_v "29.8.1 Header synopsis [numbers.syn]") = *unspecified*; template constexpr T [inv_pi_v](#lib:inv_pi_v "29.8.1 Header synopsis [numbers.syn]") = *unspecified*; template constexpr T [inv_sqrtpi_v](#lib:inv_sqrtpi_v "29.8.1 Header synopsis [numbers.syn]") = *unspecified*; template constexpr T [ln2_v](#lib:ln2_v "29.8.1 Header synopsis [numbers.syn]") = *unspecified*; template constexpr T [ln10_v](#lib:ln10_v "29.8.1 Header synopsis [numbers.syn]") = *unspecified*; template constexpr T [sqrt2_v](#lib:sqrt2_v "29.8.1 Header synopsis [numbers.syn]") = *unspecified*; template constexpr T [sqrt3_v](#lib:sqrt3_v "29.8.1 Header synopsis [numbers.syn]") = *unspecified*; template constexpr T [inv_sqrt3_v](#lib:inv_sqrt3_v "29.8.1 Header synopsis [numbers.syn]") = *unspecified*; template constexpr T [egamma_v](#lib:egamma_v "29.8.1 Header synopsis [numbers.syn]") = *unspecified*; template constexpr T [phi_v](#lib:phi_v "29.8.1 Header synopsis [numbers.syn]") = *unspecified*; template<[floating_point](concepts.arithmetic#concept:floating_point "18.4.7 Arithmetic concepts [concepts.arithmetic]") T> constexpr T e_v = *see below*; template<[floating_point](concepts.arithmetic#concept:floating_point "18.4.7 Arithmetic concepts [concepts.arithmetic]") T> constexpr T log2e_v = *see below*; template<[floating_point](concepts.arithmetic#concept:floating_point "18.4.7 Arithmetic concepts [concepts.arithmetic]") T> constexpr T log10e_v = *see below*; template<[floating_point](concepts.arithmetic#concept:floating_point "18.4.7 Arithmetic concepts [concepts.arithmetic]") T> constexpr T pi_v = *see below*; template<[floating_point](concepts.arithmetic#concept:floating_point "18.4.7 Arithmetic concepts [concepts.arithmetic]") T> constexpr T inv_pi_v = *see below*; template<[floating_point](concepts.arithmetic#concept:floating_point "18.4.7 Arithmetic concepts [concepts.arithmetic]") T> constexpr T inv_sqrtpi_v = *see below*; template<[floating_point](concepts.arithmetic#concept:floating_point "18.4.7 Arithmetic concepts [concepts.arithmetic]") T> constexpr T ln2_v = *see below*; template<[floating_point](concepts.arithmetic#concept:floating_point "18.4.7 Arithmetic concepts [concepts.arithmetic]") T> constexpr T ln10_v = *see below*; template<[floating_point](concepts.arithmetic#concept:floating_point "18.4.7 Arithmetic concepts [concepts.arithmetic]") T> constexpr T sqrt2_v = *see below*; template<[floating_point](concepts.arithmetic#concept:floating_point "18.4.7 Arithmetic concepts [concepts.arithmetic]") T> constexpr T sqrt3_v = *see below*; template<[floating_point](concepts.arithmetic#concept:floating_point "18.4.7 Arithmetic concepts [concepts.arithmetic]") T> constexpr T inv_sqrt3_v = *see below*; template<[floating_point](concepts.arithmetic#concept:floating_point "18.4.7 Arithmetic concepts [concepts.arithmetic]") T> constexpr T egamma_v = *see below*; template<[floating_point](concepts.arithmetic#concept:floating_point "18.4.7 Arithmetic concepts [concepts.arithmetic]") T> constexpr T phi_v = *see below*; inline constexpr double [e](#lib:e "29.8.1 Header synopsis [numbers.syn]") = e_v; inline constexpr double [log2e](#lib:log2e "29.8.1 Header synopsis [numbers.syn]") = log2e_v; inline constexpr double [log10e](#lib:log10e "29.8.1 Header synopsis [numbers.syn]") = log10e_v; inline constexpr double [pi](#lib:pi "29.8.1 Header synopsis [numbers.syn]") = pi_v; inline constexpr double [inv_pi](#lib:inv_pi "29.8.1 Header synopsis [numbers.syn]") = inv_pi_v; inline constexpr double [inv_sqrtpi](#lib:inv_sqrtpi "29.8.1 Header synopsis [numbers.syn]") = inv_sqrtpi_v; inline constexpr double [ln2](#lib:ln2 "29.8.1 Header synopsis [numbers.syn]") = ln2_v; inline constexpr double [ln10](#lib:ln10 "29.8.1 Header synopsis [numbers.syn]") = ln10_v; inline constexpr double [sqrt2](#lib:sqrt2 "29.8.1 Header synopsis [numbers.syn]") = sqrt2_v; inline constexpr double [sqrt3](#lib:sqrt3 "29.8.1 Header synopsis [numbers.syn]") = sqrt3_v; inline constexpr double [inv_sqrt3](#lib:inv_sqrt3 "29.8.1 Header synopsis [numbers.syn]") = inv_sqrt3_v; inline constexpr double [egamma](#lib:egamma "29.8.1 Header synopsis [numbers.syn]") = egamma_v; inline constexpr double [phi](#lib:phi "29.8.1 Header synopsis [numbers.syn]") = phi_v;} ### [29.8.2](#math.constants) Mathematical constants [[math.constants]](math.constants) [1](#math.constants-1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L10887) The library-defined partial specializations of mathematical constant variable templates are initialized with the nearest representable values ofe,log2e,log10e,π,1π,1√π,ln2,ln10,√2,√3,1√3, the Euler-Mascheroni γ constant, and the golden ratio φ constant 1+√52, respectively[.](#math.constants-1.sentence-1) [2](#math.constants-2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L10906) Pursuant to [[namespace.std]](namespace.std "16.4.5.2.1 Namespace std"), a program may partially or explicitly specialize a mathematical constant variable template provided that the specialization depends on a program-defined type[.](#math.constants-2.sentence-1) [3](#math.constants-3) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L10912) A program that instantiates a primary template of a mathematical constant variable template is ill-formed[.](#math.constants-3.sentence-1)