Topic: Math constants


Author: lev@compuserve.com
Date: Sat, 4 Mar 2017 10:32:34 -0800 (PST)
Raw View
------=_Part_892_2028161316.1488652354032
Content-Type: multipart/alternative;
 boundary="----=_Part_893_1462458480.1488652354033"

------=_Part_893_1462458480.1488652354033
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable









*Hello everyone,        Many areas of software development where C++ is=20
actively used involve mathematical calculations. The language inherited a=
=20
sizable math function library from C, and now has its own numerics library=
=20
that grows with every release. There is however a small but annoying=20
omission: C++ standard headers do not include definitions of mathematical=
=20
constants. To this math major it appears to be a very strange gap: wherever=
=20
common mathematical functions are used, the constants such as  =CF=80 or e=
=20
appear quite frequently. Yes, it is not terribly difficult to define a=20
constant, but from the C++ user's perspective this is as if they were=20
served a dish at a restaurant but asked to bring their own salt.        =20
True, many math.h headers include M_PI and other constant definitions. I=20
see a few problems with this. First,the predecessor defines are notoriously=
=20
unsafe, and the C++ community has been trying to move away from them since=
=20
its very first days. Second, relying on them is not helpful for code's=20
portability, and sometimes requires an additional macro definition such=20
us _USE_MATH_DEFINES. Third, these definition are available only by the=20
grace of the specific vendor implementation. For example, the code=20
fragment#include <cstdlib>#define _USE_MATH_DEFINES#include <cmath>const=20
double PI =3D M_PI;compiles in Microsoft Visual C++ 2015 but errors out in=
=20
Visual C++ 2017 RC because the M_PI is no longer available. I think a=20
solution would be very uncontroversial and easy to implement.The header=20
<cmath> should include as part of the std namespace the definitions of=20
common math constants specified at long double precision. For example,=20
depending on the length of long double, that portion of the header may look=
=20
as follows:namespace std { const long double PI =3D 3.14159265358979323846;=
=20
// pi const long double E =3D 2.71828182845904523536; // e const long doubl=
e=20
LOG2E =3D 1.44269504088896340736; // log2(e) const long double LOG10E =3D=
=20
0.434294481903251827651; // log10(e) const long double LN2 =3D=20
0.693147180559945309417; // ln(2) const long double LN10 =3D=20
2.30258509299404568402; // ln(10) const long double SQRT2 =3D=20
1.41421356237309504880; // sqrt(2)}          - Lev*

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/ad05f2f2-609d-4fd3-90f7-d66c74e168b7%40isocpp.or=
g.

------=_Part_893_1462458480.1488652354033
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><b><div>Hello everyone,</div><div><br></div><div>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 Many areas of software development where C++ is ac=
tively used involve mathematical calculations. The language inherited a siz=
able math function library from C, and now has its own numerics library tha=
t grows with every release. There is however a small but annoying omission:=
 C++ standard headers do not include definitions of mathematical constants.=
 To this math major it appears to be a very strange gap: wherever common ma=
thematical functions are used, the constants such as =C2=A0=CF=80 or e appe=
ar quite frequently. Yes, it is not terribly difficult to define a constant=
, but from the C++ user&#39;s perspective this is as if they were served a =
dish at a restaurant but asked to bring their own salt.=C2=A0</div><div><br=
></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 True, many math.h headers include M=
_PI and other constant definitions. I see a few problems with this. First,<=
/div><div>the predecessor defines are notoriously unsafe, and the C++ commu=
nity has been trying to move away from them since its very first days. Seco=
nd, relying on them is not helpful for code&#39;s portability, and sometime=
s requires an additional macro definition such us=C2=A0</div><div>_USE_MATH=
_DEFINES. Third, these definition are available only by the grace of the sp=
ecific vendor implementation. For example, the code fragment</div><div><br>=
</div><div>#include &lt;cstdlib&gt;</div><div>#define _USE_MATH_DEFINES</di=
v><div>#include &lt;cmath&gt;</div><div>const double PI =3D M_PI;</div><div=
><br></div><div>compiles in Microsoft Visual C++ 2015 but errors out in Vis=
ual C++ 2017 RC because the M_PI is no longer available.</div><div><br></di=
v><div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>I t=
hink a solution would be very uncontroversial and easy to implement.The hea=
der &lt;cmath&gt; should include as part of the std namespace the definitio=
ns of common math constants specified at long double precision. For example=
, depending on the length of long double, that portion of the header may lo=
ok as follows:</div><div><br></div><div><div>namespace std {</div><div><spa=
n class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>const long dou=
ble PI =3D 3.14159265358979323846;<span class=3D"Apple-tab-span" style=3D"w=
hite-space:pre">  </span>// pi</div><div><span class=3D"Apple-tab-span" sty=
le=3D"white-space:pre"> </span>const long double E =3D 2.718281828459045235=
36;<span class=3D"Apple-tab-span" style=3D"white-space:pre">  </span>// e</=
div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>c=
onst long double LOG2E =3D 1.44269504088896340736;<span class=3D"Apple-tab-=
span" style=3D"white-space:pre"> </span>// log2(e)</div><div><span class=3D=
"Apple-tab-span" style=3D"white-space:pre"> </span>const long double LOG10E=
 =3D 0.434294481903251827651; // log10(e)</div><div><span class=3D"Apple-ta=
b-span" style=3D"white-space:pre"> </span>const long double LN2 =3D 0.69314=
7180559945309417;<span class=3D"Apple-tab-span" style=3D"white-space:pre"> =
</span>// ln(2)</div><div><span class=3D"Apple-tab-span" style=3D"white-spa=
ce:pre"> </span>const long double LN10 =3D 2.30258509299404568402;<span cla=
ss=3D"Apple-tab-span" style=3D"white-space:pre"> </span>// ln(10)</div><div=
><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>const lon=
g double SQRT2 =3D 1.41421356237309504880;<span class=3D"Apple-tab-span" st=
yle=3D"white-space:pre"> </span>// sqrt(2)</div><div>}</div></div><div><br>=
</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 - Lev</div></b></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/ad05f2f2-609d-4fd3-90f7-d66c74e168b7%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/ad05f2f2-609d-4fd3-90f7-d66c74e168b7=
%40isocpp.org</a>.<br />

------=_Part_893_1462458480.1488652354033--

------=_Part_892_2028161316.1488652354032--

.


Author: Vishal Oza <vickoza@gmail.com>
Date: Sat, 4 Mar 2017 11:16:55 -0800 (PST)
Raw View
------=_Part_5769_355744591.1488655015814
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

I am not sure I would like these values written as manual constants but rat=
her as constexpr constants that are evaluated one during ethier compilation=
 or linking. This has the advantage of being as accurate at the hardware al=
lows while have the same runtime as a constant.

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/8aec2d3e-60e3-4dbf-890d-3450a32ca6d3%40isocpp.or=
g.

------=_Part_5769_355744591.1488655015814--

.


Author: lev@compuserve.com
Date: Sat, 4 Mar 2017 12:30:40 -0800 (PST)
Raw View
------=_Part_1002_1497323857.1488659440206
Content-Type: multipart/alternative;
 boundary="----=_Part_1003_943666784.1488659440206"

------=_Part_1003_943666784.1488659440206
Content-Type: text/plain; charset=UTF-8

My initial line of thought was that const in this context would be
equivalent to constexpr. This appears to be a gray area when it comes to
implementations, so you are probably correct. Here is the revision:

namespace std {
constexpr long double PI = 3.14159265358979323846;      // pi
constexpr long double E = 2.71828182845904523536;      // e
constexpr long double LOG2E = 1.44269504088896340736;     // log2(e)
constexpr long double LOG10E = 0.434294481903251827651; // log10(e)
constexpr long double LN2 = 0.693147180559945309417;      // ln(2)
constexpr long double LN10 = 2.30258509299404568402;      // ln(10)
constexpr long double SQRT2 = 1.41421356237309504880;     // sqrt(2)
}

On Saturday, March 4, 2017 at 2:16:56 PM UTC-5, Vishal Oza wrote:
>
> I am not sure I would like these values written as manual constants but
> rather as constexpr constants that are evaluated one during ethier
> compilation or linking. This has the advantage of being as accurate at the
> hardware allows while have the same runtime as a constant.

--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/7327f25a-3d77-4d97-808e-678b3458ee52%40isocpp.org.

------=_Part_1003_943666784.1488659440206
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">My initial line of thought was that const in this context =
would be equivalent to constexpr. This appears to be a gray area when it co=
mes to implementations, so you are probably correct. Here is the revision:<=
div><br></div><div>namespace std {<br></div><div><div><span class=3D"Apple-=
tab-span" style=3D"white-space:pre"> </span>constexpr long double PI =3D 3.=
14159265358979323846;<span class=3D"Apple-tab-span" style=3D"white-space:pr=
e"> </span>=C2=A0 =C2=A0 =C2=A0// pi</div><div><span class=3D"Apple-tab-spa=
n" style=3D"white-space:pre"> </span>constexpr long double E =3D 2.71828182=
845904523536;<span class=3D"Apple-tab-span" style=3D"white-space:pre">  </s=
pan>=C2=A0 =C2=A0 =C2=A0// e</div><div><span class=3D"Apple-tab-span" style=
=3D"white-space:pre"> </span>constexpr long double LOG2E =3D 1.442695040888=
96340736; =C2=A0 =C2=A0 // log2(e)</div><div><span class=3D"Apple-tab-span"=
 style=3D"white-space:pre"> </span>constexpr long double LOG10E =3D 0.43429=
4481903251827651; // log10(e)</div><div><span class=3D"Apple-tab-span" styl=
e=3D"white-space:pre"> </span>constexpr long double LN2 =3D 0.6931471805599=
45309417;<span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>=
=C2=A0 =C2=A0 =C2=A0// ln(2)</div><div><span class=3D"Apple-tab-span" style=
=3D"white-space:pre"> </span>constexpr long double LN10 =3D 2.3025850929940=
4568402;<span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>=
=C2=A0 =C2=A0 =C2=A0// ln(10)</div><div><span class=3D"Apple-tab-span" styl=
e=3D"white-space:pre"> </span>constexpr long double SQRT2 =3D 1.41421356237=
309504880; =C2=A0 =C2=A0 // sqrt(2)</div><div>}</div><br>On Saturday, March=
 4, 2017 at 2:16:56 PM UTC-5, Vishal Oza wrote:<blockquote class=3D"gmail_q=
uote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;pad=
ding-left: 1ex;">I am not sure I would like these values written as manual =
constants but rather as constexpr constants that are evaluated one during e=
thier compilation or linking. This has the advantage of being as accurate a=
t the hardware allows while have the same runtime as a constant.</blockquot=
e></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/7327f25a-3d77-4d97-808e-678b3458ee52%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/7327f25a-3d77-4d97-808e-678b3458ee52=
%40isocpp.org</a>.<br />

------=_Part_1003_943666784.1488659440206--

------=_Part_1002_1497323857.1488659440206--

.


Author: =?UTF-8?Q?Daniel_Kr=C3=BCgler?= <daniel.kruegler@gmail.com>
Date: Sat, 4 Mar 2017 22:18:11 +0100
Raw View
2017-03-04 21:30 GMT+01:00  <lev@compuserve.com>:
> My initial line of thought was that const in this context would be
> equivalent to constexpr. This appears to be a gray area when it comes to
> implementations, so you are probably correct. Here is the revision:
>
> namespace std {
> constexpr long double PI = 3.14159265358979323846;      // pi
> constexpr long double E = 2.71828182845904523536;      // e
> constexpr long double LOG2E = 1.44269504088896340736;     // log2(e)
> constexpr long double LOG10E = 0.434294481903251827651; // log10(e)
> constexpr long double LN2 = 0.693147180559945309417;      // ln(2)
> constexpr long double LN10 = 2.30258509299404568402;      // ln(10)
> constexpr long double SQRT2 = 1.41421356237309504880;     // sqrt(2)
> }

Given that we have variable templates now, why should the standard
library provide these constants for a specific floating point type?
Furthermore the UPPERCASE names look like macros, I would instead
suggest to switch to a different spelling (I would be ok if only the
first letter would be uppercase).

Depending on the outcome of CWG issue 1729, we could define pi as
follows (in namespace std, not shown below, concrete values are just
indicated):

template<class T>
extern T pi;

template<>
inline constexpr long double pi<long double> = 3.1415926535897932384...L;

template<>
inline constexpr double pi<double> = 3.1415926535...;

template<>
inline constexpr float pi<float> = 3.141592...F;

- Daniel

--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAGNvRgC0OAaFxsdgJHWJ34A8a4cc%3DLEdU05kigWjtOmEOg3_ZQ%40mail.gmail.com.

.


Author: lev@compuserve.com
Date: Sat, 4 Mar 2017 13:40:13 -0800 (PST)
Raw View
------=_Part_672_1959060678.1488663613107
Content-Type: multipart/alternative;
 boundary="----=_Part_673_1957152851.1488663613107"

------=_Part_673_1957152851.1488663613107
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Yes, the variable templates would be a logical next step. There may be some=
=20
additional issues with them, and I would very much prefer such issues not=
=20
to be an impediment for the core idea. As to the spelling, in my view all=
=20
upper case doesn't necessarily imply a macro but rather a constant=20
expression. I do not have a strong opinion in that regard however.

On Saturday, March 4, 2017 at 4:18:14 PM UTC-5, Daniel Kr=C3=BCgler wrote:
>
> 2017-03-04 21:30 GMT+01:00  <l...@compuserve.com <javascript:>>:=20
> Given that we have variable templates now, why should the standard=20
> library provide these constants for a specific floating point type?=20
> Furthermore the UPPERCASE names look like macros, I would instead=20
> suggest to switch to a different spelling (I would be ok if only the=20
> first letter would be uppercase).=20
>
> Depending on the outcome of CWG issue 1729, we could define pi as=20
> follows (in namespace std, not shown below, concrete values are just=20
> indicated):=20
>
> template<class T>=20
> extern T pi;=20
>
> template<>=20
> inline constexpr long double pi<long double> =3D 3.1415926535897932384...=
L;=20
>
> template<>=20
> inline constexpr double pi<double> =3D 3.1415926535...;=20
>
> template<>=20
> inline constexpr float pi<float> =3D 3.141592...F;=20
>
> - Daniel=20
>

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/097e0a3f-275d-45e7-babb-d3f80e1fa83d%40isocpp.or=
g.

------=_Part_673_1957152851.1488663613107
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Yes, the variable templates would be a logical next step. =
There may be some additional issues with them, and I would very much prefer=
 such issues not to be an impediment for the core idea. As to the spelling,=
 in my view all upper case doesn&#39;t necessarily imply a macro but rather=
 a constant expression. I do not have a strong opinion in that regard howev=
er.<br><br>On Saturday, March 4, 2017 at 4:18:14 PM UTC-5, Daniel Kr=C3=BCg=
ler wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:=
 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">2017-03-04 21:30 GMT=
+01:00 =C2=A0&lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-m=
ailto=3D"-YwsZPqxCgAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;jav=
ascript:&#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;re=
turn true;">l...@compuserve.com</a>&gt;:
<br>Given that we have variable templates now, why should the standard
<br>library provide these constants for a specific floating point type?
<br>Furthermore the UPPERCASE names look like macros, I would instead
<br>suggest to switch to a different spelling (I would be ok if only the
<br>first letter would be uppercase).
<br>
<br>Depending on the outcome of CWG issue 1729, we could define pi as
<br>follows (in namespace std, not shown below, concrete values are just
<br>indicated):
<br>
<br>template&lt;class T&gt;
<br>extern T pi;
<br>
<br>template&lt;&gt;
<br>inline constexpr long double pi&lt;long double&gt; =3D 3.14159265358979=
32384...L;
<br>
<br>template&lt;&gt;
<br>inline constexpr double pi&lt;double&gt; =3D 3.1415926535...;
<br>
<br>template&lt;&gt;
<br>inline constexpr float pi&lt;float&gt; =3D 3.141592...F;
<br>
<br>- Daniel
<br></blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/097e0a3f-275d-45e7-babb-d3f80e1fa83d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/097e0a3f-275d-45e7-babb-d3f80e1fa83d=
%40isocpp.org</a>.<br />

------=_Part_673_1957152851.1488663613107--

------=_Part_672_1959060678.1488663613107--

.


Author: 3dw4rd@verizon.net
Date: Thu, 9 Mar 2017 14:44:32 -0800 (PST)
Raw View
------=_Part_951_1972070828.1489099472968
Content-Type: multipart/alternative;
 boundary="----=_Part_952_1398975516.1489099472971"

------=_Part_952_1398975516.1489099472971
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



On Saturday, March 4, 2017 at 1:32:34 PM UTC-5, l...@compuserve.com wrote:
>
>
>
>
>
>
>
> *Hello everyone,        Many areas of software development where C++ is=
=20
> actively used involve mathematical calculations. The language inherited a=
=20
> sizable math function library from C, and now has its own numerics librar=
y=20
> that grows with every release. There is however a small but annoying=20
> omission: C++ standard headers do not include definitions of mathematical=
=20
> constants. To this math major it appears to be a very strange gap: wherev=
er=20
> common mathematical functions are used, the constants such as  =CF=80 or =
e=20
> appear quite frequently. Yes, it is not terribly difficult to define a=20
> constant, but from the C++ user's perspective this is as if they were=20
> served a dish at a restaurant but asked to bring their own salt.        =
=20
> True, many math.h headers include M_PI and other constant definitions. I=
=20
> see a few problems with this. First,the predecessor defines are notorious=
ly=20
> unsafe, and the C++ community has been trying to move away from them sinc=
e=20
> its very first days. Second, relying on them is not helpful for code's=20
> portability, and sometimes requires an additional macro definition such=
=20
> us _USE_MATH_DEFINES. Third, these definition are available only by the=
=20
> grace of the specific vendor implementation. For example, the code=20
> fragment#include <cstdlib>#define _USE_MATH_DEFINES#include <cmath>const=
=20
> double PI =3D M_PI;compiles in Microsoft Visual C++ 2015 but errors out i=
n=20
> Visual C++ 2017 RC because the M_PI is no longer available. I think a=20
> solution would be very uncontroversial and easy to implement.The header=
=20
> <cmath> should include as part of the std namespace the definitions of=20
> common math constants specified at long double precision. For example,=20
> depending on the length of long double, that portion of the header may lo=
ok=20
> as follows:namespace std { const long double PI =3D 3.1415926535897932384=
6;=20
> // pi const long double E =3D 2.71828182845904523536; // e const long dou=
ble=20
> LOG2E =3D 1.44269504088896340736; // log2(e) const long double LOG10E =3D=
=20
> 0.434294481903251827651; // log10(e) const long double LN2 =3D=20
> 0.693147180559945309417; // ln(2) const long double LN10 =3D=20
> 2.30258509299404568402; // ln(10) const long double SQRT2 =3D=20
> 1.41421356237309504880; // sqrt(2)}*
>


I had dabbled with this after variable templates were added.  I took that=
=20
route.
I think that this could devolve into endless bikeshed discussions and what=
=20
constants to include.=20

Design decisions:
1. variable templates.
2. In analogy with ud literals sub-directories place constants in constants=
=20
sub-directories.
3. I prefixed the math constants with m_ but c_ for constant may be better.

--------------------------------------------------------------------------
/*
  Variable template math constants for the standard library.
  Edward M. Smith-Rowland <esmith-rowland at alionscience dot com>
  2014-03-12

  We have variable templates in C++14.  In fact pi was offered as a use=20
case for that feature.
  We can do math constants right.  The constants in math.h are double=20
precision
  and promote computations unless you cast or erode long double precision.
  These M_* constants are actually POSIX compatibility - std C++ does not=
=20
mandate them.
  GCC has extension for long double versions suffixed by 'l'
  (but apparently no float versions with 'f' suffix).
  In any case these macros don't help with generic code.
  There are several bespoke versions of generic template math constants=20
around libstdc++
  using all the pre-variable-template techniques and with all the=20
annoyances outlined
  by the variable template proposal.

  'Grammar' + Bikeshedding
  I find 'm_' gives me flexibility in the 'grammar'.  We could do just=20
'_'.  Or 'c_'.
  Dividing numbers: 1_2 is 1/2, pi_2 is pi/2. Alt. _div_ seems wordy.
  Multiples of pi: Npi (2pi, 4pi).   For some reason nobody cares about=20
multiples of e
  but 2e that would be my proposal for 2*e<> if someone were to want.
  Function args preceded by '_' (unlike math.h!) make things easier to=20
read.  Alt. revert that to math.h.
  Lower case because these are not macros and because that's how we roll in=
=20
the std library.

  What to put in?
  Help people with intensive calculations.
  Division and sqrt are are more expensive than multiplication and integral=
=20
powers.
  Logs can take a while too.
  On the other hand, logs and square roots of integers appear in series=20
expansions of various
  functions.  Rather than having just a few, perhaps a substantial table=20
would be in order.

  This is a superset of math.h, <ext/cmath> from libstdc++ (with different=
=20
grammar).

  Prevent collision with an extra constants namespace after std.
  Add namespace versioning.
  Should I insert an experimental namespace between std and constants?

  Should we default to double?  Doing so might play nice with auto.

  Although it spoils the genericity of the template variable constants
  we could offer typedefs to the different precisions.  I'll hold off for=
=20
now.

  I made the constants and math_constants name spaces inline for the same=
=20
reason
  library literal operator namespaces are inline: using std to get the math=
=20
functions
  should give you access to the constants as well.

  This would go in some <cmath> or another.
 */

// Toy implementation:

#if __cplusplus <=3D 201103L
# include <bits/c++14_warning.h>
#else

namespace std
{
namespace experimental
{
inline namespace maths_v1
{
inline namespace constants
{
inline namespace math_constants
{
  /// Constant: @f$ \pi @f$ (see POSIX @c M_PI).
  template<typename _RealType>
    constexpr _RealType
    m_pi            =3D 3.1415'92653'58979'32384'62643'38327'95028'84195e+0=
L;

  /// Constant: @f$ \pi / 2 @f$ (see POSIX @c M_PI_2).
  template<typename _RealType>
    constexpr _RealType
    m_pi_2          =3D 1.5707'96326'79489'66192'31321'69163'97514'42098e+0=
L;

  /// Constant: @f$ \pi / 3 @f$.
  template<typename _RealType>
    constexpr _RealType
    m_pi_3          =3D 1.0471'97551'19659'77461'54214'46109'31676'28063e+0=
L;

  /// Constant: @f$ \pi / 4 @f$ (see POSIX @c M_PI_4).
  template<typename _RealType>
    constexpr _RealType
    m_pi_4          =3D 7.8539'81633'97448'30961'56608'45819'87572'10488e-1=
L;

  /// Constant: @f$ 4 \pi / 3 @f$.
  template<typename _RealType>
    constexpr _RealType
    m_4pi_3         =3D 4.1887'90204'78639'09846'16857'84437'26705'12253e+0=
L;

  /// Constant: @f$ 2 \pi @f$.
  template<typename _RealType>
    constexpr _RealType
    m_2pi           =3D 6.2831'85307'17958'64769'25286'76655'90057'68391e+0=
L;

  /// Constant: @f$ 4 \pi @f$.
  template<typename _RealType>
    constexpr _RealType
    m_4pi           =3D 1.2566'37061'43591'72953'85057'35331'18011'53678e+1=
L;

  /// Constant: degrees per radian @f$ 180 / \pi @f$.
  template<typename _RealType>
    constexpr _RealType
    m_deg_rad       =3D 5.7295'77951'30823'20876'79815'48141'05170'33237e+1=
L;

  /// Constant: radians per degree @f$ \pi / 180 @f$.
  template<typename _RealType>
    constexpr _RealType
    m_rad_deg       =3D 1.7453'29251'99432'95769'23690'76848'86127'13443e-2=
L;

  /// Constant: @f$ \sqrt{\pi / 2} @f$.
  template<typename _RealType>
    constexpr _RealType
    m_sqrt_pi_2     =3D 1.2533'14137'31550'02512'07882'64240'55226'26505e+0=
L;

  /// Constant: @f$ 1 / \pi @f$ (see POSIX @c M_1_PI).
  template<typename _RealType>
    constexpr _RealType
    m_1_pi          =3D 3.1830'98861'83790'67153'77675'26745'02872'40691e-1=
L;

  /// Constant: @f$ 2 / \pi @f$ (see POSIX @c M_2_PI).
  template<typename _RealType>
    constexpr _RealType
    m_2_pi          =3D 6.3661'97723'67581'34307'55350'53490'05744'81383e-1=
L;

  /// Constant: @f$ 1 / \sqrt{\pi} @f$.
  template<typename _RealType>
    constexpr _RealType
    m_1_sqrt_pi     =3D 5.6418'95835'47756'28694'80794'51560'77258'58438e-1=
L;

  /// Constant: @f$ \sqrt{\pi} @f$.
  template<typename _RealType>
    constexpr _RealType
    m_sqrt_pi       =3D 1.7724'53850'90551'60272'98167'48334'11451'82797e+0=
L;

  /// Constant: @f$ 2 / \sqrt{\pi} @f$ (see POSIX @c M_2_SQRTPI).
  template<typename _RealType>
    constexpr _RealType
    m_2_sqrt_pi     =3D 1.1283'79167'09551'25738'96158'90312'15451'71688e+0=
L;

  /// Constant: Euler's number @f$ e @f$ (see POSIX @c M_E).
  template<typename _RealType>
    constexpr _RealType
    m_e             =3D 2.7182'81828'45904'52353'60287'47135'26624'97759e+0=
L;

  /// Constant: @f$ 1 / e @f$.
  template<typename _RealType>
    constexpr _RealType
    m_1_e           =3D 3.6787'94411'71442'32159'55237'70161'46086'74462e-1=
L;

  /// Constant: @f$ \log_2(e) @f$ (see POSIX @c M_LOG2E).
  template<typename _RealType>
    constexpr _RealType
    m_log2_e        =3D 1.4426'95040'88896'34073'59924'68100'18921'37427e+0=
L;

  /// Constant: @f$ \log_2(10) @f$.
  template<typename _RealType>
    constexpr _RealType
    m_log2_10       =3D 3.3219'28094'88736'23478'70319'42948'93901'75867e+0=
L;

  /// Constant: @f$ \log_10(2) @f$.
  template<typename _RealType>
    constexpr _RealType
    m_log10_2       =3D 3.0102'99956'63981'19521'37388'94724'49302'67680e-1=
L;

  /// Constant: @f$ \log_10(e) @f$ (see POSIX @c M_LOG10E).
  template<typename _RealType>
    constexpr _RealType
    m_log10_e       =3D 4.3429'44819'03251'82765'11289'18916'60508'22940e-1=
L;

  /// Constant: @f$ \log_10(pi) @f$.
  template<typename _RealType>
    constexpr _RealType
    m_log10_pi      =3D 4.9714'98726'94133'85435'12682'88290'89887'36507e-1=
L;

  /// Constant: @f$ \ln(2) @f$ (see POSIX @c M_LN2).
  template<typename _RealType>
    constexpr _RealType
    m_ln_2          =3D 6.9314'71805'59945'30941'72321'21458'17656'80748e-1=
L;

  /// Constant: @f$ \ln(3) @f$.
  template<typename _RealType>
    constexpr _RealType
    m_ln_3          =3D 1.0986'12288'66810'96913'95245'23692'25257'04648e+0=
L;

  /// Constant: @f$ \ln(10)@f$ (see POSIX @c M_LN10).
  template<typename _RealType>
    constexpr _RealType
    m_ln_10         =3D 2.3025'85092'99404'56840'17991'45468'43642'07602e+0=
L;

  /// Constant: Euler-Mascheroni @f$ \gamma_E @f$.
  template<typename _RealType>
    constexpr _RealType
    m_gamma_e       =3D 5.7721'56649'01532'86060'65120'90082'40243'10432e-1=
L;

  /// Constant: Golden Ratio @f$ \phi =3D (1 + \sqrt{5})/2 @f$.
  template<typename _RealType>
    constexpr _RealType
    m_phi           =3D 1.6180'33988'74989'48482'04586'83436'56381'17720e+0=
L;

  /// Constant: @f$ \sqrt{2}@f$ (see POSIX @c M_SQRT2).
  template<typename _RealType>
    constexpr _RealType
    m_sqrt_2        =3D 1.4142'13562'37309'50488'01688'72420'96980'78569e+0=
L;

  /// Constant: @f$ \sqrt{3} @f$.
  template<typename _RealType>
    constexpr _RealType
    m_sqrt_3        =3D 1.7320'50807'56887'72935'27446'34150'58723'66945e+0=
L;

  /// Constant: @f$ \sqrt{5} @f$.
  template<typename _RealType>
    constexpr _RealType
    m_sqrt_5        =3D 2.2360'67977'49978'96964'09173'66873'12762'35440e+0=
L;

  /// Constant: @f$ \sqrt{7} @f$.
  template<typename _RealType>
    constexpr _RealType
    m_sqrt_7        =3D 2.6457'51311'06459'05905'01615'75363'92604'25706e+0=
L;

  /// Constant: @f$ 1 / \sqrt{2}@f$ (see POSIX @c M_SQRT1_2).
  template<typename _RealType>
    constexpr _RealType
    m_1_sqrt_2      =3D 7.0710'67811'86547'52440'08443'62104'84903'92845e-1=
L;

  /// Constant: Catalan's @f$ G =3D 1 - 1/9 + 1/25 - 1/49 + 1/81 - ... @f$.
  template<typename _RealType>
    constexpr _RealType
    m_catalan       =3D 9.1596'55941'77219'01505'46035'14932'38411'07741e-1=
L;

  /// Constant: @f$ \pi^2/6 @f$.
  template<typename _RealType>
    constexpr _RealType
    m_pi2_6         =3D 1.6449'34066'84822'64364'72415'16664'60251'89218e+0=
L;

} // inline namespace math_constants
} // inline namespace constants
} // inline namespace maths_v1
} // namespace experimental
} // namespace std

#endif // C++14



--------------------------------------------------------------------------

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/6bccd7e5-82ad-4c59-9f72-f7fb6639c0ca%40isocpp.or=
g.

------=_Part_952_1398975516.1489099472971
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Saturday, March 4, 2017 at 1:32:34 PM UTC-5, l.=
...@compuserve.com wrote:<blockquote class=3D"gmail_quote" style=3D"margin: =
0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div d=
ir=3D"ltr"><div><b><div>Hello everyone,</div><div><br></div><div>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 Many areas of software development where C++ is actively =
used involve mathematical calculations. The language inherited a sizable ma=
th function library from C, and now has its own numerics library that grows=
 with every release. There is however a small but annoying omission: C++ st=
andard headers do not include definitions of mathematical constants. To thi=
s math major it appears to be a very strange gap: wherever common mathemati=
cal functions are used, the constants such as =C2=A0=CF=80 or e appear quit=
e frequently. Yes, it is not terribly difficult to define a constant, but f=
rom the C++ user&#39;s perspective this is as if they were served a dish at=
 a restaurant but asked to bring their own salt.=C2=A0</div><div><br></div>=
<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 True, many math.h headers include M_PI and=
 other constant definitions. I see a few problems with this. First,</div><d=
iv>the predecessor defines are notoriously unsafe, and the C++ community ha=
s been trying to move away from them since its very first days. Second, rel=
ying on them is not helpful for code&#39;s portability, and sometimes requi=
res an additional macro definition such us=C2=A0</div><div>_USE_MATH_DEFINE=
S. Third, these definition are available only by the grace of the specific =
vendor implementation. For example, the code fragment</div><div><br></div><=
div>#include &lt;cstdlib&gt;</div><div>#define _USE_MATH_DEFINES</div><div>=
#include &lt;cmath&gt;</div><div>const double PI =3D M_PI;</div><div><br></=
div><div>compiles in Microsoft Visual C++ 2015 but errors out in Visual C++=
 2017 RC because the M_PI is no longer available.</div><div><br></div><div>=
<span style=3D"white-space:pre"> </span>I think a solution would be very un=
controversial and easy to implement.The header &lt;cmath&gt; should include=
 as part of the std namespace the definitions of common math constants spec=
ified at long double precision. For example, depending on the length of lon=
g double, that portion of the header may look as follows:</div><div><br></d=
iv><div><div>namespace std {</div><div><span style=3D"white-space:pre"> </s=
pan>const long double PI =3D 3.14159265358979323846;<span style=3D"white-sp=
ace:pre">  </span>// pi</div><div><span style=3D"white-space:pre"> </span>c=
onst long double E =3D 2.71828182845904523536;<span style=3D"white-space:pr=
e">  </span>// e</div><div><span style=3D"white-space:pre"> </span>const lo=
ng double LOG2E =3D 1.44269504088896340736;<span style=3D"white-space:pre">=
 </span>// log2(e)</div><div><span style=3D"white-space:pre"> </span>const =
long double LOG10E =3D 0.434294481903251827651; // log10(e)</div><div><span=
 style=3D"white-space:pre"> </span>const long double LN2 =3D 0.693147180559=
945309417;<span style=3D"white-space:pre"> </span>// ln(2)</div><div><span =
style=3D"white-space:pre"> </span>const long double LN10 =3D 2.302585092994=
04568402;<span style=3D"white-space:pre"> </span>// ln(10)</div><div><span =
style=3D"white-space:pre"> </span>const long double SQRT2 =3D 1.41421356237=
309504880;<span style=3D"white-space:pre"> </span>// sqrt(2)</div><div>}</d=
iv></div></b></div></div></blockquote><div><br><br>I had dabbled with this =
after variable templates were added.=C2=A0 I took that route.<br>I think th=
at this could devolve into endless bikeshed discussions and what constants =
to include. <br><br>Design decisions:<br>1. variable templates.<br>2. In an=
alogy with ud literals sub-directories place constants in constants sub-dir=
ectories.<br>3. I prefixed the math constants with m_ but c_ for constant m=
ay be better.<br><br>------------------------------------------------------=
--------------------<br>/*<br>=C2=A0 Variable template math constants for t=
he standard library.<br>=C2=A0 Edward M. Smith-Rowland &lt;esmith-rowland a=
t alionscience dot com&gt;<br>=C2=A0 2014-03-12<br><br>=C2=A0 We have varia=
ble templates in C++14.=C2=A0 In fact pi was offered as a use case for that=
 feature.<br>=C2=A0 We can do math constants right.=C2=A0 The constants in =
math.h are double precision<br>=C2=A0 and promote computations unless you c=
ast or erode long double precision.<br>=C2=A0 These M_* constants are actua=
lly POSIX compatibility - std C++ does not mandate them.<br>=C2=A0 GCC has =
extension for long double versions suffixed by &#39;l&#39;<br>=C2=A0 (but a=
pparently no float versions with &#39;f&#39; suffix).<br>=C2=A0 In any case=
 these macros don&#39;t help with generic code.<br>=C2=A0 There are several=
 bespoke versions of generic template math constants around libstdc++<br>=
=C2=A0 using all the pre-variable-template techniques and with all the anno=
yances outlined<br>=C2=A0 by the variable template proposal.<br><br>=C2=A0 =
&#39;Grammar&#39; + Bikeshedding<br>=C2=A0 I find &#39;m_&#39; gives me fle=
xibility in the &#39;grammar&#39;.=C2=A0 We could do just &#39;_&#39;.=C2=
=A0 Or &#39;c_&#39;.<br>=C2=A0 Dividing numbers: 1_2 is 1/2, pi_2 is pi/2. =
Alt. _div_ seems wordy.<br>=C2=A0 Multiples of pi: Npi (2pi, 4pi).=C2=A0=C2=
=A0 For some reason nobody cares about multiples of e<br>=C2=A0 but 2e that=
 would be my proposal for 2*e&lt;&gt; if someone were to want.<br>=C2=A0 Fu=
nction args preceded by &#39;_&#39; (unlike math.h!) make things easier to =
read.=C2=A0 Alt. revert that to math.h.<br>=C2=A0 Lower case because these =
are not macros and because that&#39;s how we roll in the std library.<br><b=
r>=C2=A0 What to put in?<br>=C2=A0 Help people with intensive calculations.=
<br>=C2=A0 Division and sqrt are are more expensive than multiplication and=
 integral powers.<br>=C2=A0 Logs can take a while too.<br>=C2=A0 On the oth=
er hand, logs and square roots of integers appear in series expansions of v=
arious<br>=C2=A0 functions.=C2=A0 Rather than having just a few, perhaps a =
substantial table would be in order.<br><br>=C2=A0 This is a superset of ma=
th.h, &lt;ext/cmath&gt; from libstdc++ (with different grammar).<br><br>=C2=
=A0 Prevent collision with an extra constants namespace after std.<br>=C2=
=A0 Add namespace versioning.<br>=C2=A0 Should I insert an experimental nam=
espace between std and constants?<br><br>=C2=A0 Should we default to double=
?=C2=A0 Doing so might play nice with auto.<br><br>=C2=A0 Although it spoil=
s the genericity of the template variable constants<br>=C2=A0 we could offe=
r typedefs to the different precisions.=C2=A0 I&#39;ll hold off for now.<br=
><br>=C2=A0 I made the constants and math_constants name spaces inline for =
the same reason<br>=C2=A0 library literal operator namespaces are inline: u=
sing std to get the math functions<br>=C2=A0 should give you access to the =
constants as well.<br><br>=C2=A0 This would go in some &lt;cmath&gt; or ano=
ther.<br>=C2=A0*/<br><br><div style=3D"background-color: rgb(250, 250, 250)=
; border-color: rgb(187, 187, 187); border-style: solid; border-width: 1px;=
 overflow-wrap: break-word;" class=3D"prettyprint"><code class=3D"prettypri=
nt"><div class=3D"subprettyprint"><span style=3D"color: #800;" class=3D"sty=
led-by-prettify">// Toy implementation:</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"><br><br></span><span style=3D"color: #800;" cl=
ass=3D"styled-by-prettify">#if __cplusplus &lt;=3D 201103L</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"c=
olor: #800;" class=3D"styled-by-prettify"># include &lt;bits/c++14_warning.=
h&gt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><=
/span><span style=3D"color: #800;" class=3D"styled-by-prettify">#else</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br></span><=
span style=3D"color: #008;" class=3D"styled-by-prettify">namespace</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> std<br></span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">namespace</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> experimental<br></span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #008=
;" class=3D"styled-by-prettify">inline</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"s=
tyled-by-prettify">namespace</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> maths_v1<br></span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br></span><span style=3D"color: #008;" class=3D"styled-by-pret=
tify">inline</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">namespa=
ce</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> constan=
ts<br></span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><s=
pan style=3D"color: #008;" class=3D"styled-by-prettify">inline</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"=
color: #008;" class=3D"styled-by-prettify">namespace</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> math_constants<br></span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"><br>=C2=A0 </span><span style=3D"=
color: #800;" class=3D"styled-by-prettify">/// Constant: @f$ \pi @f$ (see P=
OSIX @c M_PI).</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"><br>=C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-prett=
ify">template</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">&lt;</span><span style=3D"color: #008;" class=3D"styled-by-prettify">typ=
ename</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> _Rea=
lType</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =
=C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-prettify">con=
stexpr</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> _Re=
alType<br>=C2=A0 =C2=A0 m_pi =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D=
"color: #066;" class=3D"styled-by-prettify">3.1415</span><span style=3D"col=
or: #080;" class=3D"styled-by-prettify">&#39;92653&#39;</span><span style=
=3D"color: #066;" class=3D"styled-by-prettify">58979</span><span style=3D"c=
olor: #080;" class=3D"styled-by-prettify">&#39;32384&#39;</span><span style=
=3D"color: #066;" class=3D"styled-by-prettify">62643</span><span style=3D"c=
olor: #080;" class=3D"styled-by-prettify">&#39;38327&#39;</span><span style=
=3D"color: #066;" class=3D"styled-by-prettify">95028</span><span style=3D"c=
olor: #080;" class=3D"styled-by-prettify">&#39;84195e+0L;<br><br>=C2=A0 ///=
 Constant: @f$ \pi / 2 @f$ (see POSIX @c M_PI_2).<br>=C2=A0 template&lt;typ=
ename _RealType&gt;<br>=C2=A0 =C2=A0 constexpr _RealType<br>=C2=A0 =C2=A0 m=
_pi_2 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D 1.5707&#39;</span><span style=
=3D"color: #066;" class=3D"styled-by-prettify">96326</span><span style=3D"c=
olor: #080;" class=3D"styled-by-prettify">&#39;79489&#39;</span><span style=
=3D"color: #066;" class=3D"styled-by-prettify">66192</span><span style=3D"c=
olor: #080;" class=3D"styled-by-prettify">&#39;31321&#39;</span><span style=
=3D"color: #066;" class=3D"styled-by-prettify">69163</span><span style=3D"c=
olor: #080;" class=3D"styled-by-prettify">&#39;97514&#39;</span><span style=
=3D"color: #066;" class=3D"styled-by-prettify">42098e+0L</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 </span><span style=3D"=
color: #800;" class=3D"styled-by-prettify">/// Constant: @f$ \pi / 3 @f$.</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 <=
/span><span style=3D"color: #008;" class=3D"styled-by-prettify">template</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><s=
pan style=3D"color: #008;" class=3D"styled-by-prettify">typename</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> _RealType</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><s=
pan style=3D"color: #008;" class=3D"styled-by-prettify">constexpr</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> _RealType<br>=C2=A0=
 =C2=A0 m_pi_3 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> </span><span style=3D"color: #066;" class=
=3D"styled-by-prettify">1.0471</span><span style=3D"color: #080;" class=3D"=
styled-by-prettify">&#39;97551&#39;</span><span style=3D"color: #066;" clas=
s=3D"styled-by-prettify">19659</span><span style=3D"color: #080;" class=3D"=
styled-by-prettify">&#39;77461&#39;</span><span style=3D"color: #066;" clas=
s=3D"styled-by-prettify">54214</span><span style=3D"color: #080;" class=3D"=
styled-by-prettify">&#39;46109&#39;</span><span style=3D"color: #066;" clas=
s=3D"styled-by-prettify">31676</span><span style=3D"color: #080;" class=3D"=
styled-by-prettify">&#39;28063e+0L;<br><br>=C2=A0 /// Constant: @f$ \pi / 4=
 @f$ (see POSIX @c M_PI_4).<br>=C2=A0 template&lt;typename _RealType&gt;<br=
>=C2=A0 =C2=A0 constexpr _RealType<br>=C2=A0 =C2=A0 m_pi_4 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0=3D 7.8539&#39;</span><span style=3D"color: #066;" clas=
s=3D"styled-by-prettify">81633</span><span style=3D"color: #080;" class=3D"=
styled-by-prettify">&#39;97448&#39;</span><span style=3D"color: #066;" clas=
s=3D"styled-by-prettify">30961</span><span style=3D"color: #080;" class=3D"=
styled-by-prettify">&#39;56608&#39;</span><span style=3D"color: #066;" clas=
s=3D"styled-by-prettify">45819</span><span style=3D"color: #080;" class=3D"=
styled-by-prettify">&#39;87572&#39;</span><span style=3D"color: #066;" clas=
s=3D"styled-by-prettify">10488e-1L</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"><br><br>=C2=A0 </span><span style=3D"color: #800;" class=3D"=
styled-by-prettify">/// Constant: @f$ 4 \pi / 3 @f$.</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"><br>=C2=A0 </span><span style=3D"=
color: #008;" class=3D"styled-by-prettify">template</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #=
008;" class=3D"styled-by-prettify">typename</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> _RealType</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #=
008;" class=3D"styled-by-prettify">constexpr</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> _RealType<br>=C2=A0 =C2=A0 m_4pi_3 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> </span><span style=3D"color: #066;" class=3D"styled-by-prettify">4=
..1887</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;=
90204&#39;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">=
78639</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;=
09846&#39;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">=
16857</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;=
84437&#39;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">=
26705</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;=
12253e+0L;<br><br>=C2=A0 /// Constant: @f$ 2 \pi @f$.<br>=C2=A0 template&lt=
;typename _RealType&gt;<br>=C2=A0 =C2=A0 constexpr _RealType<br>=C2=A0 =C2=
=A0 m_2pi =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D 6.2831&#39;</span><span st=
yle=3D"color: #066;" class=3D"styled-by-prettify">85307</span><span style=
=3D"color: #080;" class=3D"styled-by-prettify">&#39;17958&#39;</span><span =
style=3D"color: #066;" class=3D"styled-by-prettify">64769</span><span style=
=3D"color: #080;" class=3D"styled-by-prettify">&#39;25286&#39;</span><span =
style=3D"color: #066;" class=3D"styled-by-prettify">76655</span><span style=
=3D"color: #080;" class=3D"styled-by-prettify">&#39;90057&#39;</span><span =
style=3D"color: #066;" class=3D"styled-by-prettify">68391e+0L</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 </span><span style=
=3D"color: #800;" class=3D"styled-by-prettify">/// Constant: @f$ 4 \pi @f$.=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0=
 </span><span style=3D"color: #008;" class=3D"styled-by-prettify">template<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span>=
<span style=3D"color: #008;" class=3D"styled-by-prettify">typename</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> _RealType</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span>=
<span style=3D"color: #008;" class=3D"styled-by-prettify">constexpr</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> _RealType<br>=C2=
=A0 =C2=A0 m_4pi =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #066;" cla=
ss=3D"styled-by-prettify">1.2566</span><span style=3D"color: #080;" class=
=3D"styled-by-prettify">&#39;37061&#39;</span><span style=3D"color: #066;" =
class=3D"styled-by-prettify">43591</span><span style=3D"color: #080;" class=
=3D"styled-by-prettify">&#39;72953&#39;</span><span style=3D"color: #066;" =
class=3D"styled-by-prettify">85057</span><span style=3D"color: #080;" class=
=3D"styled-by-prettify">&#39;35331&#39;</span><span style=3D"color: #066;" =
class=3D"styled-by-prettify">18011</span><span style=3D"color: #080;" class=
=3D"styled-by-prettify">&#39;53678e+1L;<br><br>=C2=A0 /// Constant: degrees=
 per radian @f$ 180 / \pi @f$.<br>=C2=A0 template&lt;typename _RealType&gt;=
<br>=C2=A0 =C2=A0 constexpr _RealType<br>=C2=A0 =C2=A0 m_deg_rad =C2=A0 =C2=
=A0 =C2=A0 =3D 5.7295&#39;</span><span style=3D"color: #066;" class=3D"styl=
ed-by-prettify">77951</span><span style=3D"color: #080;" class=3D"styled-by=
-prettify">&#39;30823&#39;</span><span style=3D"color: #066;" class=3D"styl=
ed-by-prettify">20876</span><span style=3D"color: #080;" class=3D"styled-by=
-prettify">&#39;79815&#39;</span><span style=3D"color: #066;" class=3D"styl=
ed-by-prettify">48141</span><span style=3D"color: #080;" class=3D"styled-by=
-prettify">&#39;05170&#39;</span><span style=3D"color: #066;" class=3D"styl=
ed-by-prettify">33237e+1L</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">;</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"><br><br>=C2=A0 </span><span style=3D"color: #800;" class=3D"styled-by=
-prettify">/// Constant: radians per degree @f$ \pi / 180 @f$.</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 </span><span=
 style=3D"color: #008;" class=3D"styled-by-prettify">template</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">typename</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> _RealType</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span sty=
le=3D"color: #008;" class=3D"styled-by-prettify">constexpr</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> _RealType<br>=C2=A0 =C2=A0=
 m_rad_deg =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by-pr=
ettify">1.7453</span><span style=3D"color: #080;" class=3D"styled-by-pretti=
fy">&#39;29251&#39;</span><span style=3D"color: #066;" class=3D"styled-by-p=
rettify">99432</span><span style=3D"color: #080;" class=3D"styled-by-pretti=
fy">&#39;95769&#39;</span><span style=3D"color: #066;" class=3D"styled-by-p=
rettify">23690</span><span style=3D"color: #080;" class=3D"styled-by-pretti=
fy">&#39;76848&#39;</span><span style=3D"color: #066;" class=3D"styled-by-p=
rettify">86127</span><span style=3D"color: #080;" class=3D"styled-by-pretti=
fy">&#39;13443e-2L;<br><br>=C2=A0 /// Constant: @f$ \sqrt{\pi / 2} @f$.<br>=
=C2=A0 template&lt;typename _RealType&gt;<br>=C2=A0 =C2=A0 constexpr _RealT=
ype<br>=C2=A0 =C2=A0 m_sqrt_pi_2 =C2=A0 =C2=A0 =3D 1.2533&#39;</span><span =
style=3D"color: #066;" class=3D"styled-by-prettify">14137</span><span style=
=3D"color: #080;" class=3D"styled-by-prettify">&#39;31550&#39;</span><span =
style=3D"color: #066;" class=3D"styled-by-prettify">02512</span><span style=
=3D"color: #080;" class=3D"styled-by-prettify">&#39;07882&#39;</span><span =
style=3D"color: #066;" class=3D"styled-by-prettify">64240</span><span style=
=3D"color: #080;" class=3D"styled-by-prettify">&#39;55226&#39;</span><span =
style=3D"color: #066;" class=3D"styled-by-prettify">26505e+0L</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 </span><span style=
=3D"color: #800;" class=3D"styled-by-prettify">/// Constant: @f$ 1 / \pi @f=
$ (see POSIX @c M_1_PI).</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"><br>=C2=A0 </span><span style=3D"color: #008;" class=3D"style=
d-by-prettify">template</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">&lt;</span><span style=3D"color: #008;" class=3D"styled-by-pre=
ttify">typename</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"> _RealType</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">&gt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><=
br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-pre=
ttify">constexpr</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> _RealType<br>=C2=A0 =C2=A0 m_1_pi =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span sty=
le=3D"color: #066;" class=3D"styled-by-prettify">3.1830</span><span style=
=3D"color: #080;" class=3D"styled-by-prettify">&#39;98861&#39;</span><span =
style=3D"color: #066;" class=3D"styled-by-prettify">83790</span><span style=
=3D"color: #080;" class=3D"styled-by-prettify">&#39;67153&#39;</span><span =
style=3D"color: #066;" class=3D"styled-by-prettify">77675</span><span style=
=3D"color: #080;" class=3D"styled-by-prettify">&#39;26745&#39;</span><span =
style=3D"color: #066;" class=3D"styled-by-prettify">02872</span><span style=
=3D"color: #080;" class=3D"styled-by-prettify">&#39;40691e-1L;<br><br>=C2=
=A0 /// Constant: @f$ 2 / \pi @f$ (see POSIX @c M_2_PI).<br>=C2=A0 template=
&lt;typename _RealType&gt;<br>=C2=A0 =C2=A0 constexpr _RealType<br>=C2=A0 =
=C2=A0 m_2_pi =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D 6.3661&#39;</span><span=
 style=3D"color: #066;" class=3D"styled-by-prettify">97723</span><span styl=
e=3D"color: #080;" class=3D"styled-by-prettify">&#39;67581&#39;</span><span=
 style=3D"color: #066;" class=3D"styled-by-prettify">34307</span><span styl=
e=3D"color: #080;" class=3D"styled-by-prettify">&#39;55350&#39;</span><span=
 style=3D"color: #066;" class=3D"styled-by-prettify">53490</span><span styl=
e=3D"color: #080;" class=3D"styled-by-prettify">&#39;05744&#39;</span><span=
 style=3D"color: #066;" class=3D"styled-by-prettify">81383e-1L</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 </span><span styl=
e=3D"color: #800;" class=3D"styled-by-prettify">/// Constant: @f$ 1 / \sqrt=
{\pi} @f$.</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
<br>=C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-prettify"=
>template</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&=
lt;</span><span style=3D"color: #008;" class=3D"styled-by-prettify">typenam=
e</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> _RealTyp=
e</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=
=A0 </span><span style=3D"color: #008;" class=3D"styled-by-prettify">conste=
xpr</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> _RealT=
ype<br>=C2=A0 =C2=A0 m_1_sqrt_pi =C2=A0 =C2=A0 </span><span style=3D"color:=
 #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> </span><span style=3D"color: #066;" class=3D=
"styled-by-prettify">5.6418</span><span style=3D"color: #080;" class=3D"sty=
led-by-prettify">&#39;95835&#39;</span><span style=3D"color: #066;" class=
=3D"styled-by-prettify">47756</span><span style=3D"color: #080;" class=3D"s=
tyled-by-prettify">&#39;28694&#39;</span><span style=3D"color: #066;" class=
=3D"styled-by-prettify">80794</span><span style=3D"color: #080;" class=3D"s=
tyled-by-prettify">&#39;51560&#39;</span><span style=3D"color: #066;" class=
=3D"styled-by-prettify">77258</span><span style=3D"color: #080;" class=3D"s=
tyled-by-prettify">&#39;58438e-1L;<br><br>=C2=A0 /// Constant: @f$ \sqrt{\p=
i} @f$.<br>=C2=A0 template&lt;typename _RealType&gt;<br>=C2=A0 =C2=A0 const=
expr _RealType<br>=C2=A0 =C2=A0 m_sqrt_pi =C2=A0 =C2=A0 =C2=A0 =3D 1.7724&#=
39;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">53850</=
span><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;90551&#=
39;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">60272</=
span><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;98167&#=
39;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">48334</=
span><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;11451&#=
39;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">82797e+=
0L</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 </=
span><span style=3D"color: #800;" class=3D"styled-by-prettify">/// Constant=
: @f$ 2 / \sqrt{\pi} @f$ (see POSIX @c M_2_SQRTPI).</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"><br>=C2=A0 </span><span style=3D"c=
olor: #008;" class=3D"styled-by-prettify">template</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #0=
08;" class=3D"styled-by-prettify">typename</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> _RealType</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #0=
08;" class=3D"styled-by-prettify">constexpr</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> _RealType<br>=C2=A0 =C2=A0 m_2_sqrt_pi =
=C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </=
span><span style=3D"color: #066;" class=3D"styled-by-prettify">1.1283</span=
><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;79167&#39;<=
/span><span style=3D"color: #066;" class=3D"styled-by-prettify">09551</span=
><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;25738&#39;<=
/span><span style=3D"color: #066;" class=3D"styled-by-prettify">96158</span=
><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;90312&#39;<=
/span><span style=3D"color: #066;" class=3D"styled-by-prettify">15451</span=
><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;71688e+0L;<=
br><br>=C2=A0 /// Constant: Euler&#39;</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify">s number </span><span style=3D"color: #066;" cl=
ass=3D"styled-by-prettify">@f$</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> e </span><span style=3D"color: #066;" class=3D"styled-=
by-prettify">@f$</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify">see POSIX </=
span><span style=3D"color: #066;" class=3D"styled-by-prettify">@c</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> M_E</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">).</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"><br>=C2=A0 </span><span style=3D"c=
olor: #008;" class=3D"styled-by-prettify">template</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #0=
08;" class=3D"styled-by-prettify">typename</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> _RealType</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #0=
08;" class=3D"styled-by-prettify">constexpr</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> _RealType<br>=C2=A0 =C2=A0 m_e =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by-pr=
ettify">2.7182</span><span style=3D"color: #080;" class=3D"styled-by-pretti=
fy">&#39;81828&#39;</span><span style=3D"color: #066;" class=3D"styled-by-p=
rettify">45904</span><span style=3D"color: #080;" class=3D"styled-by-pretti=
fy">&#39;52353&#39;</span><span style=3D"color: #066;" class=3D"styled-by-p=
rettify">60287</span><span style=3D"color: #080;" class=3D"styled-by-pretti=
fy">&#39;47135&#39;</span><span style=3D"color: #066;" class=3D"styled-by-p=
rettify">26624</span><span style=3D"color: #080;" class=3D"styled-by-pretti=
fy">&#39;97759e+0L;<br><br>=C2=A0 /// Constant: @f$ 1 / e @f$.<br>=C2=A0 te=
mplate&lt;typename _RealType&gt;<br>=C2=A0 =C2=A0 constexpr _RealType<br>=
=C2=A0 =C2=A0 m_1_e =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D 3.6787&#39;</spa=
n><span style=3D"color: #066;" class=3D"styled-by-prettify">94411</span><sp=
an style=3D"color: #080;" class=3D"styled-by-prettify">&#39;71442&#39;</spa=
n><span style=3D"color: #066;" class=3D"styled-by-prettify">32159</span><sp=
an style=3D"color: #080;" class=3D"styled-by-prettify">&#39;55237&#39;</spa=
n><span style=3D"color: #066;" class=3D"styled-by-prettify">70161</span><sp=
an style=3D"color: #080;" class=3D"styled-by-prettify">&#39;46086&#39;</spa=
n><span style=3D"color: #066;" class=3D"styled-by-prettify">74462e-1L</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 </span><sp=
an style=3D"color: #800;" class=3D"styled-by-prettify">/// Constant: @f$ \l=
og_2(e) @f$ (see POSIX @c M_LOG2E).</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"><br>=C2=A0 </span><span style=3D"color: #008;" cla=
ss=3D"styled-by-prettify">template</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">&lt;</span><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">typename</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> _RealType</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">&gt;</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">constexpr</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> _RealType<br>=C2=A0 =C2=A0 m_log2_e =C2=A0 =C2=A0 =C2=A0 =
=C2=A0</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an style=3D"color: #066;" class=3D"styled-by-prettify">1.4426</span><span s=
tyle=3D"color: #080;" class=3D"styled-by-prettify">&#39;95040&#39;</span><s=
pan style=3D"color: #066;" class=3D"styled-by-prettify">88896</span><span s=
tyle=3D"color: #080;" class=3D"styled-by-prettify">&#39;34073&#39;</span><s=
pan style=3D"color: #066;" class=3D"styled-by-prettify">59924</span><span s=
tyle=3D"color: #080;" class=3D"styled-by-prettify">&#39;68100&#39;</span><s=
pan style=3D"color: #066;" class=3D"styled-by-prettify">18921</span><span s=
tyle=3D"color: #080;" class=3D"styled-by-prettify">&#39;37427e+0L;<br><br>=
=C2=A0 /// Constant: @f$ \log_2(10) @f$.<br>=C2=A0 template&lt;typename _Re=
alType&gt;<br>=C2=A0 =C2=A0 constexpr _RealType<br>=C2=A0 =C2=A0 m_log2_10 =
=C2=A0 =C2=A0 =C2=A0 =3D 3.3219&#39;</span><span style=3D"color: #066;" cla=
ss=3D"styled-by-prettify">28094</span><span style=3D"color: #080;" class=3D=
"styled-by-prettify">&#39;88736&#39;</span><span style=3D"color: #066;" cla=
ss=3D"styled-by-prettify">23478</span><span style=3D"color: #080;" class=3D=
"styled-by-prettify">&#39;70319&#39;</span><span style=3D"color: #066;" cla=
ss=3D"styled-by-prettify">42948</span><span style=3D"color: #080;" class=3D=
"styled-by-prettify">&#39;93901&#39;</span><span style=3D"color: #066;" cla=
ss=3D"styled-by-prettify">75867e+0L</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"><br><br>=C2=A0 </span><span style=3D"color: #800;" class=3D=
"styled-by-prettify">/// Constant: @f$ \log_10(2) @f$.</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 </span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">template</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">typename</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> _RealType</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">constexpr</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> _RealType<br>=C2=A0 =C2=A0 m_log10=
_2 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> </span><span style=3D"color: #066;" class=3D"styled-by-prettify">3.=
0102</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;9=
9956&#39;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">6=
3981</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;1=
9521&#39;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">3=
7388</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;9=
4724&#39;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">4=
9302</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;6=
7680e-1L;<br><br>=C2=A0 /// Constant: @f$ \log_10(e) @f$ (see POSIX @c M_LO=
G10E).<br>=C2=A0 template&lt;typename _RealType&gt;<br>=C2=A0 =C2=A0 conste=
xpr _RealType<br>=C2=A0 =C2=A0 m_log10_e =C2=A0 =C2=A0 =C2=A0 =3D 4.3429&#3=
9;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">44819</s=
pan><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;03251&#3=
9;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">82765</s=
pan><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;11289&#3=
9;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">18916</s=
pan><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;60508&#3=
9;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">22940e-1=
L</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 </s=
pan><span style=3D"color: #800;" class=3D"styled-by-prettify">/// Constant:=
 @f$ \log_10(pi) @f$.</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br>=C2=A0 </span><span style=3D"color: #008;" class=3D"styled-b=
y-prettify">template</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">&lt;</span><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">typename</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> _RealType</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">&gt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">constexpr</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> _RealType<br>=C2=A0 =C2=A0 m_log10_pi =C2=A0 =C2=A0 =C2=A0</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #066;" class=3D"styled-by-prettify">4.9714</span><span style=3D"color: #0=
80;" class=3D"styled-by-prettify">&#39;98726&#39;</span><span style=3D"colo=
r: #066;" class=3D"styled-by-prettify">94133</span><span style=3D"color: #0=
80;" class=3D"styled-by-prettify">&#39;85435&#39;</span><span style=3D"colo=
r: #066;" class=3D"styled-by-prettify">12682</span><span style=3D"color: #0=
80;" class=3D"styled-by-prettify">&#39;88290&#39;</span><span style=3D"colo=
r: #066;" class=3D"styled-by-prettify">89887</span><span style=3D"color: #0=
80;" class=3D"styled-by-prettify">&#39;36507e-1L;<br><br>=C2=A0 /// Constan=
t: @f$ \ln(2) @f$ (see POSIX @c M_LN2).<br>=C2=A0 template&lt;typename _Rea=
lType&gt;<br>=C2=A0 =C2=A0 constexpr _RealType<br>=C2=A0 =C2=A0 m_ln_2 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D 6.9314&#39;</span><span style=3D"color: =
#066;" class=3D"styled-by-prettify">71805</span><span style=3D"color: #080;=
" class=3D"styled-by-prettify">&#39;59945&#39;</span><span style=3D"color: =
#066;" class=3D"styled-by-prettify">30941</span><span style=3D"color: #080;=
" class=3D"styled-by-prettify">&#39;72321&#39;</span><span style=3D"color: =
#066;" class=3D"styled-by-prettify">21458</span><span style=3D"color: #080;=
" class=3D"styled-by-prettify">&#39;17656&#39;</span><span style=3D"color: =
#066;" class=3D"styled-by-prettify">80748e-1L</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"><br><br>=C2=A0 </span><span style=3D"color: #800;=
" class=3D"styled-by-prettify">/// Constant: @f$ \ln(3) @f$.</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 </span><span s=
tyle=3D"color: #008;" class=3D"styled-by-prettify">template</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"=
color: #008;" class=3D"styled-by-prettify">typename</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> _RealType</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"=
color: #008;" class=3D"styled-by-prettify">constexpr</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> _RealType<br>=C2=A0 =C2=A0 m_ln_=
3 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by-=
prettify">1.0986</span><span style=3D"color: #080;" class=3D"styled-by-pret=
tify">&#39;12288&#39;</span><span style=3D"color: #066;" class=3D"styled-by=
-prettify">66810</span><span style=3D"color: #080;" class=3D"styled-by-pret=
tify">&#39;96913&#39;</span><span style=3D"color: #066;" class=3D"styled-by=
-prettify">95245</span><span style=3D"color: #080;" class=3D"styled-by-pret=
tify">&#39;23692&#39;</span><span style=3D"color: #066;" class=3D"styled-by=
-prettify">25257</span><span style=3D"color: #080;" class=3D"styled-by-pret=
tify">&#39;04648e+0L;<br><br>=C2=A0 /// Constant: @f$ \ln(10)@f$ (see POSIX=
 @c M_LN10).<br>=C2=A0 template&lt;typename _RealType&gt;<br>=C2=A0 =C2=A0 =
constexpr _RealType<br>=C2=A0 =C2=A0 m_ln_10 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=3D 2.3025&#39;</span><span style=3D"color: #066;" class=3D"styled-by-prett=
ify">85092</span><span style=3D"color: #080;" class=3D"styled-by-prettify">=
&#39;99404&#39;</span><span style=3D"color: #066;" class=3D"styled-by-prett=
ify">56840</span><span style=3D"color: #080;" class=3D"styled-by-prettify">=
&#39;17991&#39;</span><span style=3D"color: #066;" class=3D"styled-by-prett=
ify">45468</span><span style=3D"color: #080;" class=3D"styled-by-prettify">=
&#39;43642&#39;</span><span style=3D"color: #066;" class=3D"styled-by-prett=
ify">07602e+0L</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><=
br>=C2=A0 </span><span style=3D"color: #800;" class=3D"styled-by-prettify">=
/// Constant: Euler-Mascheroni @f$ \gamma_E @f$.</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"><br>=C2=A0 </span><span style=3D"colo=
r: #008;" class=3D"styled-by-prettify">template</span><span style=3D"color:=
 #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #008;=
" class=3D"styled-by-prettify">typename</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> _RealType</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008=
;" class=3D"styled-by-prettify">constexpr</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> _RealType<br>=C2=A0 =C2=A0 m_gamma_e =C2=A0=
 =C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> <=
/span><span style=3D"color: #066;" class=3D"styled-by-prettify">5.7721</spa=
n><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;56649&#39;=
</span><span style=3D"color: #066;" class=3D"styled-by-prettify">01532</spa=
n><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;86060&#39;=
</span><span style=3D"color: #066;" class=3D"styled-by-prettify">65120</spa=
n><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;90082&#39;=
</span><span style=3D"color: #066;" class=3D"styled-by-prettify">40243</spa=
n><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;10432e-1L;=
<br><br>=C2=A0 /// Constant: Golden Ratio @f$ \phi =3D (1 + \sqrt{5})/2 @f$=
..<br>=C2=A0 template&lt;typename _RealType&gt;<br>=C2=A0 =C2=A0 constexpr _=
RealType<br>=C2=A0 =C2=A0 m_phi =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D 1.61=
80&#39;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">339=
88</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;749=
89&#39;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">484=
82</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;045=
86&#39;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">834=
36</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;563=
81&#39;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">177=
20e+0L</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=C2=
=A0 </span><span style=3D"color: #800;" class=3D"styled-by-prettify">/// Co=
nstant: @f$ \sqrt{2}@f$ (see POSIX @c M_SQRT2).</span><span style=3D"color:=
 #000;" class=3D"styled-by-prettify"><br>=C2=A0 </span><span style=3D"color=
: #008;" class=3D"styled-by-prettify">template</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #008;"=
 class=3D"styled-by-prettify">typename</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> _RealType</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">&gt;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008=
;" class=3D"styled-by-prettify">constexpr</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> _RealType<br>=C2=A0 =C2=A0 m_sqrt_2 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> </span><span style=3D"color: #066;" class=3D"styled-by-prettify">1.4142=
</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;13562=
&#39;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">37309=
</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;50488=
&#39;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">01688=
</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;72420=
&#39;</span><span style=3D"color: #066;" class=3D"styled-by-prettify">96980=
</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;78569=
e+0L;<br><br>=C2=A0 /// Constant: @f$ \sqrt{3} @f$.<br>=C2=A0 template&lt;t=
ypename _RealType&gt;<br>=C2=A0 =C2=A0 constexpr _RealType<br>=C2=A0 =C2=A0=
 m_sqrt_3 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D 1.7320&#39;</span><span style=3D"c=
olor: #066;" class=3D"styled-by-prettify">50807</span><span style=3D"color:=
 #080;" class=3D"styled-by-prettify">&#39;56887&#39;</span><span style=3D"c=
olor: #066;" class=3D"styled-by-prettify">72935</span><span style=3D"color:=
 #080;" class=3D"styled-by-prettify">&#39;27446&#39;</span><span style=3D"c=
olor: #066;" class=3D"styled-by-prettify">34150</span><span style=3D"color:=
 #080;" class=3D"styled-by-prettify">&#39;58723&#39;</span><span style=3D"c=
olor: #066;" class=3D"styled-by-prettify">66945e+0L</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"><br><br>=C2=A0 </span><span style=3D"color:=
 #800;" class=3D"styled-by-prettify">/// Constant: @f$ \sqrt{5} @f$.</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 </span=
><span style=3D"color: #008;" class=3D"styled-by-prettify">template</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span s=
tyle=3D"color: #008;" class=3D"styled-by-prettify">typename</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> _RealType</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span s=
tyle=3D"color: #008;" class=3D"styled-by-prettify">constexpr</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> _RealType<br>=C2=A0 =C2=
=A0 m_sqrt_5 =C2=A0 =C2=A0 =C2=A0 =C2=A0</span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #066;" class=3D"style=
d-by-prettify">2.2360</span><span style=3D"color: #080;" class=3D"styled-by=
-prettify">&#39;67977&#39;</span><span style=3D"color: #066;" class=3D"styl=
ed-by-prettify">49978</span><span style=3D"color: #080;" class=3D"styled-by=
-prettify">&#39;96964&#39;</span><span style=3D"color: #066;" class=3D"styl=
ed-by-prettify">09173</span><span style=3D"color: #080;" class=3D"styled-by=
-prettify">&#39;66873&#39;</span><span style=3D"color: #066;" class=3D"styl=
ed-by-prettify">12762</span><span style=3D"color: #080;" class=3D"styled-by=
-prettify">&#39;35440e+0L;<br><br>=C2=A0 /// Constant: @f$ \sqrt{7} @f$.<br=
>=C2=A0 template&lt;typename _RealType&gt;<br>=C2=A0 =C2=A0 constexpr _Real=
Type<br>=C2=A0 =C2=A0 m_sqrt_7 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D 2.6457&#39;</=
span><span style=3D"color: #066;" class=3D"styled-by-prettify">51311</span>=
<span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;06459&#39;</=
span><span style=3D"color: #066;" class=3D"styled-by-prettify">05905</span>=
<span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;01615&#39;</=
span><span style=3D"color: #066;" class=3D"styled-by-prettify">75363</span>=
<span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;92604&#39;</=
span><span style=3D"color: #066;" class=3D"styled-by-prettify">25706e+0L</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 </span>=
<span style=3D"color: #800;" class=3D"styled-by-prettify">/// Constant: @f$=
 1 / \sqrt{2}@f$ (see POSIX @c M_SQRT1_2).</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"><br>=C2=A0 </span><span style=3D"color: #00=
8;" class=3D"styled-by-prettify">template</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #008;" clas=
s=3D"styled-by-prettify">typename</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> _RealType</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">&gt;</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" cla=
ss=3D"styled-by-prettify">constexpr</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> _RealType<br>=C2=A0 =C2=A0 m_1_sqrt_2 =C2=A0 =C2=
=A0 =C2=A0</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span style=3D"color: #066;" class=3D"styled-by-prettify">7.0710</span><sp=
an style=3D"color: #080;" class=3D"styled-by-prettify">&#39;67811&#39;</spa=
n><span style=3D"color: #066;" class=3D"styled-by-prettify">86547</span><sp=
an style=3D"color: #080;" class=3D"styled-by-prettify">&#39;52440&#39;</spa=
n><span style=3D"color: #066;" class=3D"styled-by-prettify">08443</span><sp=
an style=3D"color: #080;" class=3D"styled-by-prettify">&#39;62104&#39;</spa=
n><span style=3D"color: #066;" class=3D"styled-by-prettify">84903</span><sp=
an style=3D"color: #080;" class=3D"styled-by-prettify">&#39;92845e-1L;<br><=
br>=C2=A0 /// Constant: Catalan&#39;</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify">s </span><span style=3D"color: #066;" class=3D"st=
yled-by-prettify">@f$</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> G </span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </=
span><span style=3D"color: #066;" class=3D"styled-by-prettify">1</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">-</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #066;" =
class=3D"styled-by-prettify">1</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">/</span><span style=3D"color: #066;" class=3D"styled-by=
-prettify">9</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">+</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span st=
yle=3D"color: #066;" class=3D"styled-by-prettify">1</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">/</span><span style=3D"color: #066=
;" class=3D"styled-by-prettify">25</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">-</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> </span><span style=3D"color: #066;" class=3D"styled-by-prettify">1</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">/</span><spa=
n style=3D"color: #066;" class=3D"styled-by-prettify">49</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">+</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> </span><span style=3D"color: #066;" class=3D"=
styled-by-prettify">1</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">/</span><span style=3D"color: #066;" class=3D"styled-by-prettify=
">81</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">-</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">...</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #066;" cla=
ss=3D"styled-by-prettify">@f$</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">.</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"><br>=C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by=
-prettify">template</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">&lt;</span><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">typename</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> _RealType</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>&gt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">constexpr</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> _RealType<br>=C2=A0 =C2=A0 m_catalan =C2=A0 =C2=A0 =C2=A0 </span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #066;" class=3D"styled-by-prettify">9.1596</span><span style=3D"color: #0=
80;" class=3D"styled-by-prettify">&#39;55941&#39;</span><span style=3D"colo=
r: #066;" class=3D"styled-by-prettify">77219</span><span style=3D"color: #0=
80;" class=3D"styled-by-prettify">&#39;01505&#39;</span><span style=3D"colo=
r: #066;" class=3D"styled-by-prettify">46035</span><span style=3D"color: #0=
80;" class=3D"styled-by-prettify">&#39;14932&#39;</span><span style=3D"colo=
r: #066;" class=3D"styled-by-prettify">38411</span><span style=3D"color: #0=
80;" class=3D"styled-by-prettify">&#39;07741e-1L;<br><br>=C2=A0 /// Constan=
t: @f$ \pi^2/6 @f$.<br>=C2=A0 template&lt;typename _RealType&gt;<br>=C2=A0 =
=C2=A0 constexpr _RealType<br>=C2=A0 =C2=A0 m_pi2_6 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =3D 1.6449&#39;</span><span style=3D"color: #066;" class=3D"styled-b=
y-prettify">34066</span><span style=3D"color: #080;" class=3D"styled-by-pre=
ttify">&#39;84822&#39;</span><span style=3D"color: #066;" class=3D"styled-b=
y-prettify">64364</span><span style=3D"color: #080;" class=3D"styled-by-pre=
ttify">&#39;72415&#39;</span><span style=3D"color: #066;" class=3D"styled-b=
y-prettify">16664</span><span style=3D"color: #080;" class=3D"styled-by-pre=
ttify">&#39;60251&#39;</span><span style=3D"color: #066;" class=3D"styled-b=
y-prettify">89218e+0L</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"><br><br></span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
}</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><=
span style=3D"color: #800;" class=3D"styled-by-prettify">// inline namespac=
e math_constants</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"><br></span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
}</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><=
span style=3D"color: #800;" class=3D"styled-by-prettify">// inline namespac=
e constants</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
><br></span><span style=3D"color: #660;" class=3D"styled-by-prettify">}</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span =
style=3D"color: #800;" class=3D"styled-by-prettify">// inline namespace mat=
hs_v1</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">}</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #800;" class=3D"styled-by-prettify">// namespace experimental</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">}</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #800;" class=3D"styled-by-prettify">// namespace std</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"><br><br></span><span style=3D"c=
olor: #800;" class=3D"styled-by-prettify">#endif</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #800;" =
class=3D"styled-by-prettify">// C+</span><span style=3D"color: #800;" class=
=3D"styled-by-prettify">+14</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"><br><br></span></div></code></div><br><br>----------------=
----------------------------------------------------------<br><br></div></d=
iv>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/6bccd7e5-82ad-4c59-9f72-f7fb6639c0ca%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/6bccd7e5-82ad-4c59-9f72-f7fb6639c0ca=
%40isocpp.org</a>.<br />

------=_Part_952_1398975516.1489099472971--

------=_Part_951_1972070828.1489099472968--

.


Author: Matthew Woehlke <mwoehlke.floss@gmail.com>
Date: Fri, 10 Mar 2017 11:19:28 -0500
Raw View
On 2017-03-09 17:44, 3dw4rd@verizon.net wrote:
> I think that this could devolve into endless bikeshed discussions and wha=
t=20
> constants to include.=20

  template <typename T>
  class pi_helper
  {
    static constexpr value =3D 3.14159...;

    constexpr operator T() { return value; }

    template <int numerator, int denominator>
    constexpr T times() { return numerator * value / denominator; }
  }

  template <typename T>
  inline constexpr pi_helper pi<T>;

....and as QOI, implementations can provide explicit specializations of
any of `times<N,D>()` that make sense. This way the namespace isn't
polluted by bunches of `pi_1_3` and so forth, and it's clearer what
value you are asking for.

For roots, I think something like:

  template <typename T, unsigned value>
  extern T sqrt;

....makes sense. We should specify that at least a particular set of
these must be available, but this would provide a hook where compilers
can provide an intrinsic such that any square root is available as a
constexpr. (This would also permit compilers to choose to provide them
via an intrinsic that can always compute them, but e.g. using a
variable-precision algorithm that ensures the result is always accurate
within the limits of the requested type.) We can do something similar
for logarithm constants.

I don't think we should have constants for 180/pi and pi/180; having
constexpr functions for these operations will I think lead to better code.

Otherwise, we should definitely have Euler's constant, on principle if
nothing else, but I don't think I've ever used the golden ratio or
anything involving square roots and pi. (When are those useful? When is
pi=C2=B2/6 useful?)

--=20
Matthew

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/58C2D210.6080900%40gmail.com.

.


Author: 3dw4rd@verizon.net
Date: Fri, 10 Mar 2017 09:08:23 -0800 (PST)
Raw View
------=_Part_1275_138652668.1489165703184
Content-Type: multipart/alternative;
 boundary="----=_Part_1276_541676777.1489165703184"

------=_Part_1276_541676777.1489165703184
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



On Friday, March 10, 2017 at 11:19:34 AM UTC-5, Matthew Woehlke wrote:
>
> On 2017-03-09 17:44, 3dw...@verizon.net <javascript:> wrote:=20
> > I think that this could devolve into endless bikeshed discussions and=
=20
> what=20
> > constants to include.=20
>
>   template <typename T>=20
>   class pi_helper=20
>   {=20
>     static constexpr value =3D 3.14159...;=20
>
>     constexpr operator T() { return value; }=20
>
>     template <int numerator, int denominator>=20
>     constexpr T times() { return numerator * value / denominator; }=20
>   }=20
>
>   template <typename T>=20
>   inline constexpr pi_helper pi<T>;=20
>
> ...and as QOI, implementations can provide explicit specializations of=20
> any of `times<N,D>()` that make sense. This way the namespace isn't=20
> polluted by bunches of `pi_1_3` and so forth, and it's clearer what=20
> value you are asking for.=20
>
=20
this is a good idea.  i think a small fraction utiity (or a ratio tool=20
would be nice in any case).
I do think that we should have specializations to cover preexisting M_XYZ=
=20
macros.


For roots, I think something like:=20
>
>   template <typename T, unsigned value>=20
>   extern T sqrt;=20
>
> ...makes sense. We should specify that at least a particular set of=20
> these must be available, but this would provide a hook where compilers=20
> can provide an intrinsic such that any square root is available as a=20
> constexpr. (This would also permit compilers to choose to provide them=20
> via an intrinsic that can always compute them, but e.g. using a=20
> variable-precision algorithm that ensures the result is always accurate=
=20
> within the limits of the requested type.) We can do something similar=20
> for logarithm constants.=20
>

I think rootls and logs would benefit greatly from a table like this.
Again, we'll specialize to cover old M_ABC macros etc.=20


> I don't think we should have constants for 180/pi and pi/180; having=20
> constexpr functions for these operations will I think lead to better code=
..=20
>

I actually agree.  And this touches on <units> which we really need.  I'd=
=20
rather have that.
We'll stay away from unit conversions here going forward.
=20

>
> Otherwise, we should definitely have Euler's constant, on principle if=20
> nothing else, but I don't think I've ever used the golden ratio or=20
> anything involving square roots and pi. (When are those useful? When is=
=20
> pi=C2=B2/6 useful?)=20
>
I've used the golden ratio to make pleasantly sized screens.
The others crop up in computing zeta functions, gamma functions, the error=
=20
function, etc.

--=20
> Matthew=20
>

One thing you touched on up there has been bothering me.  I've been working=
=20
on a batter implementation of math special functions.
I have been trying to leave room for multi-precision reals.  So pi, sqrt3=
=20
depend on the chosen precision which is not part of the type in most sane=
=20
implementations.  mpfr has functions for these.  So anyway, what I've been=
=20
using in my special function library is functions:
constexpr _Tp __const_pi(Tp _proto =3D _Tp{})

This will route by ADL (which is nice) to the constant above and be truly=
=20
constexpr for built-in primitive types.
The mpreal version won't be actually constexpr but the precision is=20
extracted from the prototype (which isn't otherwise used)
and used to call mpfr_pi(__proto.getPrecision()).

Do you have any better Idea?  This is a Fortranesque way of doing things=20
but it works and is type generic.  Fortran (and I) also do this for=20
numeric_limits objects:
constexpr Tp lim_epsilon(const Tp& proto)
routes to numeric_limits<Tp> for float, double, long double, but can call=
=20
mpreal too.

I should hold off for now on this.

The variable template approach stands on it's own and I don't think it=20
would block what I've described just above.  It hasn't so far.

Ed=20
=20

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/f481f2e9-a6bc-42af-aaba-8995e8bc4d78%40isocpp.or=
g.

------=_Part_1276_541676777.1489165703184
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Friday, March 10, 2017 at 11:19:34 AM UTC-5, Ma=
tthew Woehlke wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;ma=
rgin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On 2017-03=
-09 17:44, <a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=
=3D"aywgUCl5DAAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;javascri=
pt:&#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;return =
true;">3dw...@verizon.net</a> wrote:
<br>&gt; I think that this could devolve into endless bikeshed discussions =
and what=20
<br>&gt; constants to include.=20
<br>
<br>=C2=A0 template &lt;typename T&gt;
<br>=C2=A0 class pi_helper
<br>=C2=A0 {
<br>=C2=A0 =C2=A0 static constexpr value =3D 3.14159...;
<br>
<br>=C2=A0 =C2=A0 constexpr operator T() { return value; }
<br>
<br>=C2=A0 =C2=A0 template &lt;int numerator, int denominator&gt;
<br>=C2=A0 =C2=A0 constexpr T times() { return numerator * value / denomina=
tor; }
<br>=C2=A0 }
<br>
<br>=C2=A0 template &lt;typename T&gt;
<br>=C2=A0 inline constexpr pi_helper pi&lt;T&gt;;
<br>
<br>...and as QOI, implementations can provide explicit specializations of
<br>any of `times&lt;N,D&gt;()` that make sense. This way the namespace isn=
&#39;t
<br>polluted by bunches of `pi_1_3` and so forth, and it&#39;s clearer what
<br>value you are asking for.
<br></blockquote><div>=C2=A0<br>this is a good idea.=C2=A0 i think a small =
fraction utiity (or a ratio tool would be nice in any case).<br>I do think =
that we should have specializations to cover preexisting M_XYZ macros.<br><=
br><br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-le=
ft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">For roots, I thin=
k something like:
<br>
<br>=C2=A0 template &lt;typename T, unsigned value&gt;
<br>=C2=A0 extern T sqrt;
<br>
<br>...makes sense. We should specify that at least a particular set of
<br>these must be available, but this would provide a hook where compilers
<br>can provide an intrinsic such that any square root is available as a
<br>constexpr. (This would also permit compilers to choose to provide them
<br>via an intrinsic that can always compute them, but e.g. using a
<br>variable-precision algorithm that ensures the result is always accurate
<br>within the limits of the requested type.) We can do something similar
<br>for logarithm constants.
<br></blockquote><div><br>I think rootls and logs would benefit greatly fro=
m a table like this.<br>Again, we&#39;ll specialize to cover old M_ABC macr=
os etc. <br><br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0;=
margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
<br>I don&#39;t think we should have constants for 180/pi and pi/180; havin=
g
<br>constexpr functions for these operations will I think lead to better co=
de.
<br></blockquote><div><br>I actually agree.=C2=A0 And this touches on &lt;u=
nits&gt; which we really need.=C2=A0 I&#39;d rather have that.<br>We&#39;ll=
 stay away from unit conversions here going forward.<br>=C2=A0<br></div><bl=
ockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border=
-left: 1px #ccc solid;padding-left: 1ex;">
<br>Otherwise, we should definitely have Euler&#39;s constant, on principle=
 if
<br>nothing else, but I don&#39;t think I&#39;ve ever used the golden ratio=
 or
<br>anything involving square roots and pi. (When are those useful? When is
<br>pi=C2=B2/6 useful?)
<br></blockquote><div>I&#39;ve used the golden ratio to make pleasantly siz=
ed screens.<br>The others crop up in computing zeta functions, gamma functi=
ons, the error function, etc.<br><br></div><blockquote class=3D"gmail_quote=
" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding=
-left: 1ex;">--=20
<br>Matthew
<br></blockquote><div><br>One thing you touched on up there has been bother=
ing me.=C2=A0 I&#39;ve been working on a batter implementation of math spec=
ial functions.<br>I have been trying to leave room for multi-precision real=
s.=C2=A0 So pi, sqrt3 depend on the chosen precision which is not part of t=
he type in most sane implementations.=C2=A0 mpfr has functions for these.=
=C2=A0 So anyway, what I&#39;ve been using in my special function library i=
s functions:<br><div style=3D"background-color: rgb(250, 250, 250); border-=
color: rgb(187, 187, 187); border-style: solid; border-width: 1px; overflow=
-wrap: break-word;" class=3D"prettyprint"><code class=3D"prettyprint"><div =
class=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styled-by-pr=
ettify">constexpr</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> _Tp __const_pi</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">(</span><span style=3D"color: #606;" class=3D"styled-by-prettif=
y">Tp</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> _pro=
to </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> _Tp</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">{})</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"><br></span></div></code></d=
iv><br>This will route by ADL (which is nice) to the constant above and be =
truly constexpr for built-in primitive types.<br>The mpreal version won&#39=
;t be actually constexpr but the precision is extracted from the prototype =
(which isn&#39;t otherwise used)<br>and used to call mpfr_pi(__proto.getPre=
cision()).<br><br>Do you have any better Idea?=C2=A0 This is a Fortranesque=
 way of doing things but it works and is type generic.=C2=A0 Fortran (and I=
) also do this for numeric_limits objects:<br>constexpr Tp lim_epsilon(cons=
t Tp&amp; proto)<br>routes to numeric_limits&lt;Tp&gt; for float, double, l=
ong double, but can call mpreal too.<br><br>I should hold off for now on th=
is.<br><br>The variable template approach stands on it&#39;s own and I don&=
#39;t think it would block what I&#39;ve described just above.=C2=A0 It has=
n&#39;t so far.<br><br>Ed <br></div><div>=C2=A0</div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/f481f2e9-a6bc-42af-aaba-8995e8bc4d78%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/f481f2e9-a6bc-42af-aaba-8995e8bc4d78=
%40isocpp.org</a>.<br />

------=_Part_1276_541676777.1489165703184--

------=_Part_1275_138652668.1489165703184--

.


Author: Beman Dawes <bdawes@acm.org>
Date: Wed, 29 Mar 2017 07:04:03 -0400
Raw View
--001a113b0372987b3e054bdc8aa3
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Sat, Mar 4, 2017 at 1:32 PM, <lev@compuserve.com> wrote:

>
>
> *Hello everyone,        Many areas of software development where C++ is
> actively used involve mathematical calculations. The language inherited a
> sizable math function library from C, and now has its own numerics librar=
y
> that grows with every release. There is however a small but annoying
> omission: C++ standard headers do not include definitions of mathematical
> constants. To this math major it appears to be a very strange gap: wherev=
er
> common mathematical functions are used, the constants such as  =CF=80 or =
e
> appear quite frequently. Yes, it is not terribly difficult to define a
> constant, but from the C++ user's perspective this is as if they were
> served a dish at a restaurant but asked to bring their own salt. *
>

Hi Lev,

Are you aware of
www.boost.org/doc/libs/1_63_0/libs/math/doc/html/constants.html ?

IIRC, development of a truly useful library of C++ math functions was far
more complex than anyone would have guessed at the onset, and took several
years of effort. You might want to talk to John Maddock, Paul Bristow,
and Christopher Kormanyos first.

--Beman

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CAAygHNOvBFjUryaTbp7UT-d1mVyt8vXYptCatOpfD1DgGs-=
m8A%40mail.gmail.com.

--001a113b0372987b3e054bdc8aa3
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On Sat, Mar 4, 2017 at 1:32 PM,  <span dir=3D"ltr">&lt;<a href=3D"mailt=
o:lev@compuserve.com" target=3D"_blank">lev@compuserve.com</a>&gt;</span> w=
rote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8e=
x;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"=
><div><b><div>Hello everyone,</div><div><br></div><div>=C2=A0 =C2=A0 =C2=A0=
 =C2=A0 Many areas of software development where C++ is actively used invol=
ve mathematical calculations. The language inherited a sizable math functio=
n library from C, and now has its own numerics library that grows with ever=
y release. There is however a small but annoying omission: C++ standard hea=
ders do not include definitions of mathematical constants. To this math maj=
or it appears to be a very strange gap: wherever common mathematical functi=
ons are used, the constants such as =C2=A0=CF=80 or e appear quite frequent=
ly. Yes, it is not terribly difficult to define a constant, but from the C+=
+ user&#39;s perspective this is as if they were served a dish at a restaur=
ant but asked to bring their own salt.=C2=A0</div><div><br></div></b></div>=
</div></blockquote><div><br></div><div>Hi Lev,</div><div><br></div><div>Are=
 you aware of <a href=3D"http://www.boost.org/doc/libs/1_63_0/libs/math/doc=
/html/constants.html">www.boost.org/doc/libs/1_63_0/libs/math/doc/html/cons=
tants.html</a>=C2=A0?</div><div><br></div><div>IIRC, development of a truly=
 useful library of C++ math functions was far more complex than anyone woul=
d have guessed at the onset, and took several years of effort. You might wa=
nt to talk to John Maddock, Paul Bristow, and=C2=A0Christopher Kormanyos fi=
rst.</div><div><br></div><div>--Beman</div></div><br></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAAygHNOvBFjUryaTbp7UT-d1mVyt8vXYptCa=
tOpfD1DgGs-m8A%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAAygHNOvBFjUryaT=
bp7UT-d1mVyt8vXYptCatOpfD1DgGs-m8A%40mail.gmail.com</a>.<br />

--001a113b0372987b3e054bdc8aa3--

.


Author: "Lev Minkovsky" <lev@compuserve.com>
Date: Wed, 29 Mar 2017 07:33:48 -0400
Raw View
This is a multipart message in MIME format.

------=_NextPart_000_0001_01D2A85E.CE33D020
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi Beman,

=20

             Thank you for your message. Yes, I am aware of the good work t=
hat Boost contributors have done on Boost constants. It doesn=E2=80=99t sur=
prise me that math functions are difficult to implement in a true cross-pla=
tform and computationally stable way. I spoke with Paul Bristow via email a=
nd got some useful feedback from him.=20

=20

             The goal of my proposal is far more narrow. I focus specifical=
ly on constants, and explicitly state that several aspects of their impleme=
ntation should be left up to the implementer=E2=80=99s discretion. It is no=
t my intent at all to compile a comprehensive set of math constants. I mere=
ly want to =E2=80=9Cpush downstream=E2=80=9D the set included in several de=
rivative standardization efforts.

=20

* Lev

=20

From: beman.dawes@gmail.com [mailto:beman.dawes@gmail.com] On Behalf Of Bem=
an Dawes
Sent: Wednesday, March 29, 2017 7:04 AM
To: std-proposals <std-proposals@isocpp.org>
Subject: Re: [std-proposals] Math constants

=20

=20

=20

On Sat, Mar 4, 2017 at 1:32 PM, <lev@compuserve.com <mailto:lev@compuserve.=
com> > wrote:

Hello everyone,

=20

        Many areas of software development where C++ is actively used invol=
ve mathematical calculations. The language inherited a sizable math functio=
n library from C, and now has its own numerics library that grows with ever=
y release. There is however a small but annoying omission: C++ standard hea=
ders do not include definitions of mathematical constants. To this math maj=
or it appears to be a very strange gap: wherever common mathematical functi=
ons are used, the constants such as  =CF=80 or e appear quite frequently. Y=
es, it is not terribly difficult to define a constant, but from the C++ use=
r's perspective this is as if they were served a dish at a restaurant but a=
sked to bring their own salt.=20

=20

=20

Hi Lev,

=20

Are you aware of www.boost.org/doc/libs/1_63_0/libs/math/doc/html/constants=
..html <http://www.boost.org/doc/libs/1_63_0/libs/math/doc/html/constants.ht=
ml>  ?

=20

IIRC, development of a truly useful library of C++ math functions was far m=
ore complex than anyone would have guessed at the onset, and took several y=
ears of effort. You might want to talk to John Maddock, Paul Bristow, and C=
hristopher Kormanyos first.

=20

--Beman

=20

--=20
You received this message because you are subscribed to a topic in the Goog=
le Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this topic, visit https://groups.google.com/a/isocpp.or=
g/d/topic/std-proposals/FbSyFYzsoYI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to std-pro=
posals+unsubscribe@isocpp.org <mailto:std-proposals+unsubscribe@isocpp.org>=
 .
To post to this group, send email to std-proposals@isocpp.org <mailto:std-p=
roposals@isocpp.org> .
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CAAygHNOvBFjUryaTbp7UT-d1mVyt8vXYptCatOpfD1DgGs-=
m8A%40mail.gmail.com <https://groups.google.com/a/isocpp.org/d/msgid/std-pr=
oposals/CAAygHNOvBFjUryaTbp7UT-d1mVyt8vXYptCatOpfD1DgGs-m8A%40mail.gmail.co=
m?utm_medium=3Demail&utm_source=3Dfooter> .

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/000001d2a880%245542ff20%24ffc8fd60%24%40compuser=
ve.com.

------=_NextPart_000_0001_01D2A85E.CE33D020
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40"><head><meta http-equiv=3DContent-Type content=
=3D"text/html; charset=3Dutf-8"><meta name=3DGenerator content=3D"Microsoft=
 Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
 {font-family:Wingdings;
 panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
 {font-family:"Cambria Math";
 panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
 {font-family:Calibri;
 panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
 {margin:0in;
 margin-bottom:.0001pt;
 font-size:12.0pt;
 font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
 {mso-style-priority:99;
 color:blue;
 text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
 {mso-style-priority:99;
 color:purple;
 text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
 {mso-style-priority:34;
 margin-top:0in;
 margin-right:0in;
 margin-bottom:0in;
 margin-left:.5in;
 margin-bottom:.0001pt;
 font-size:12.0pt;
 font-family:"Times New Roman",serif;}
p.msonormal0, li.msonormal0, div.msonormal0
 {mso-style-name:msonormal;
 mso-margin-top-alt:auto;
 margin-right:0in;
 mso-margin-bottom-alt:auto;
 margin-left:0in;
 font-size:12.0pt;
 font-family:"Times New Roman",serif;}
span.EmailStyle19
 {mso-style-type:personal-reply;
 font-family:"Calibri",sans-serif;
 color:windowtext;}
..MsoChpDefault
 {mso-style-type:export-only;
 font-family:"Calibri",sans-serif;}
@page WordSection1
 {size:8.5in 11.0in;
 margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
 {page:WordSection1;}
/* List Definitions */
@list l0
 {mso-list-id:1680086989;
 mso-list-type:hybrid;
 mso-list-template-ids:979896200 -219264900 67698691 67698693 67698689 6769=
8691 67698693 67698689 67698691 67698693;}
@list l0:level1
 {mso-level-start-at:0;
 mso-level-number-format:bullet;
 mso-level-text:-;
 mso-level-tab-stop:none;
 mso-level-number-position:left;
 margin-left:.75in;
 text-indent:-.25in;
 font-family:"Calibri",sans-serif;
 mso-fareast-font-family:Calibri;}
@list l0:level2
 {mso-level-number-format:bullet;
 mso-level-text:o;
 mso-level-tab-stop:none;
 mso-level-number-position:left;
 margin-left:1.25in;
 text-indent:-.25in;
 font-family:"Courier New";}
@list l0:level3
 {mso-level-number-format:bullet;
 mso-level-text:=EF=82=A7;
 mso-level-tab-stop:none;
 mso-level-number-position:left;
 margin-left:1.75in;
 text-indent:-.25in;
 font-family:Wingdings;}
@list l0:level4
 {mso-level-number-format:bullet;
 mso-level-text:=EF=82=B7;
 mso-level-tab-stop:none;
 mso-level-number-position:left;
 margin-left:2.25in;
 text-indent:-.25in;
 font-family:Symbol;}
@list l0:level5
 {mso-level-number-format:bullet;
 mso-level-text:o;
 mso-level-tab-stop:none;
 mso-level-number-position:left;
 margin-left:2.75in;
 text-indent:-.25in;
 font-family:"Courier New";}
@list l0:level6
 {mso-level-number-format:bullet;
 mso-level-text:=EF=82=A7;
 mso-level-tab-stop:none;
 mso-level-number-position:left;
 margin-left:3.25in;
 text-indent:-.25in;
 font-family:Wingdings;}
@list l0:level7
 {mso-level-number-format:bullet;
 mso-level-text:=EF=82=B7;
 mso-level-tab-stop:none;
 mso-level-number-position:left;
 margin-left:3.75in;
 text-indent:-.25in;
 font-family:Symbol;}
@list l0:level8
 {mso-level-number-format:bullet;
 mso-level-text:o;
 mso-level-tab-stop:none;
 mso-level-number-position:left;
 margin-left:4.25in;
 text-indent:-.25in;
 font-family:"Courier New";}
@list l0:level9
 {mso-level-number-format:bullet;
 mso-level-text:=EF=82=A7;
 mso-level-tab-stop:none;
 mso-level-number-position:left;
 margin-left:4.75in;
 text-indent:-.25in;
 font-family:Wingdings;}
ol
 {margin-bottom:0in;}
ul
 {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DEN-US link=3Dblue vli=
nk=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal><span style=3D'f=
ont-size:11.0pt;font-family:"Calibri",sans-serif'>Hi Beman,<o:p></o:p></spa=
n></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Cal=
ibri",sans-serif'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span st=
yle=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Thank you for you=
r message. Yes, I am aware of the good work that Boost contributors have do=
ne on Boost constants. It doesn=E2=80=99t surprise me that math functions a=
re difficult to implement in a true cross-platform and computationally stab=
le way. I spoke with Paul Bristow via email and got some useful feedback fr=
om him. <o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size=
:11.0pt;font-family:"Calibri",sans-serif'><o:p>&nbsp;</o:p></span></p><p cl=
ass=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",sans-=
serif'>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 The goal of my proposal is far more narrow. I focus specifically on =
constants, and explicitly state that several aspects of their implementatio=
n should be left up to the implementer=E2=80=99s discretion. It is not my i=
ntent at all to compile a comprehensive set of math constants. I merely wan=
t to =E2=80=9Cpush downstream=E2=80=9D the set included in several derivati=
ve standardization efforts.<o:p></o:p></span></p><p class=3DMsoNormal><span=
 style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p>&nbsp;</o=
:p></span></p><ul style=3D'margin-top:0in' type=3Ddisc><li class=3DMsoListP=
aragraph style=3D'margin-left:.25in;mso-list:l0 level1 lfo1'><span style=3D=
'font-size:11.0pt;font-family:"Calibri",sans-serif'>Lev<o:p></o:p></span></=
li></ul><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"C=
alibri",sans-serif'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><b><sp=
an style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span>=
</b><span style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'> bema=
n.dawes@gmail.com [mailto:beman.dawes@gmail.com] <b>On Behalf Of </b>Beman =
Dawes<br><b>Sent:</b> Wednesday, March 29, 2017 7:04 AM<br><b>To:</b> std-p=
roposals &lt;std-proposals@isocpp.org&gt;<br><b>Subject:</b> Re: [std-propo=
sals] Math constants<o:p></o:p></span></p><p class=3DMsoNormal><o:p>&nbsp;<=
/o:p></p><div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><div><p class=3DMso=
Normal><o:p>&nbsp;</o:p></p><div><p class=3DMsoNormal>On Sat, Mar 4, 2017 a=
t 1:32 PM, &lt;<a href=3D"mailto:lev@compuserve.com" target=3D"_blank">lev@=
compuserve.com</a>&gt; wrote:<o:p></o:p></p><blockquote style=3D'border:non=
e;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8=
pt;margin-right:0in'><div><div><div><p class=3DMsoNormal><b>Hello everyone,=
<o:p></o:p></b></p></div><div><p class=3DMsoNormal><b><o:p>&nbsp;</o:p></b>=
</p></div><div><p class=3DMsoNormal><b>&nbsp; &nbsp; &nbsp; &nbsp; Many are=
as of software development where C++ is actively used involve mathematical =
calculations. The language inherited a sizable math function library from C=
, and now has its own numerics library that grows with every release. There=
 is however a small but annoying omission: C++ standard headers do not incl=
ude definitions of mathematical constants. To this math major it appears to=
 be a very strange gap: wherever common mathematical functions are used, th=
e constants such as &nbsp;=CF=80 or e appear quite frequently. Yes, it is n=
ot terribly difficult to define a constant, but from the C++ user's perspec=
tive this is as if they were served a dish at a restaurant but asked to bri=
ng their own salt.&nbsp;<o:p></o:p></b></p></div><div><p class=3DMsoNormal>=
<b><o:p>&nbsp;</o:p></b></p></div></div></div></blockquote><div><p class=3D=
MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=3DMsoNormal>Hi Lev,<o:p>=
</o:p></p></div><div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p></div><div><=
p class=3DMsoNormal>Are you aware of <a href=3D"http://www.boost.org/doc/li=
bs/1_63_0/libs/math/doc/html/constants.html">www.boost.org/doc/libs/1_63_0/=
libs/math/doc/html/constants.html</a>&nbsp;?<o:p></o:p></p></div><div><p cl=
ass=3DMsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=3DMsoNormal>IIRC, =
development of a truly useful library of C++ math functions was far more co=
mplex than anyone would have guessed at the onset, and took several years o=
f effort. You might want to talk to John Maddock, Paul Bristow, and&nbsp;Ch=
ristopher Kormanyos first.<o:p></o:p></p></div><div><p class=3DMsoNormal><o=
:p>&nbsp;</o:p></p></div><div><p class=3DMsoNormal>--Beman<o:p></o:p></p></=
div></div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p></div></div><p class=3D=
MsoNormal>-- <br>You received this message because you are subscribed to a =
topic in the Google Groups &quot;ISO C++ Standard - Future Proposals&quot; =
group.<br>To unsubscribe from this topic, visit <a href=3D"https://groups.g=
oogle.com/a/isocpp.org/d/topic/std-proposals/FbSyFYzsoYI/unsubscribe">https=
://groups.google.com/a/isocpp.org/d/topic/std-proposals/FbSyFYzsoYI/unsubsc=
ribe</a>.<br>To unsubscribe from this group and all its topics, send an ema=
il to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposals=
+unsubscribe@isocpp.org</a>.<br>To post to this group, send email to <a hre=
f=3D"mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</a>.<br>To v=
iew this discussion on the web visit <a href=3D"https://groups.google.com/a=
/isocpp.org/d/msgid/std-proposals/CAAygHNOvBFjUryaTbp7UT-d1mVyt8vXYptCatOpf=
D1DgGs-m8A%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAAygHNOvBFjUryaT=
bp7UT-d1mVyt8vXYptCatOpfD1DgGs-m8A%40mail.gmail.com</a>.<o:p></o:p></p></di=
v></body></html>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/000001d2a880%245542ff20%24ffc8fd60%24=
%40compuserve.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.go=
ogle.com/a/isocpp.org/d/msgid/std-proposals/000001d2a880%245542ff20%24ffc8f=
d60%24%40compuserve.com</a>.<br />

------=_NextPart_000_0001_01D2A85E.CE33D020--


.


Author: lev@compuserve.com
Date: Wed, 29 Mar 2017 04:34:10 -0700 (PDT)
Raw View
------=_Part_164_1067762707.1490787250753
Content-Type: multipart/alternative;
 boundary="----=_Part_165_1484881662.1490787250753"

------=_Part_165_1484881662.1490787250753
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



Hi Beman,

=20

             Thank you for your message. Yes, I am aware of the good work=
=20
that Boost contributors have done on Boost constants. It doesn=E2=80=99t su=
rprise=20
me that math functions are difficult to implement in a true cross-platform=
=20
and computationally stable way. I spoke with Paul Bristow via email and got=
=20
some useful feedback from him.=20

=20

             The goal of my proposal is far more narrow. I focus=20
specifically on constants, and explicitly state that several aspects of=20
their implementation should be left up to the implementer=E2=80=99s discret=
ion. It=20
is not my intent at all to compile a comprehensive set of math constants. I=
=20
merely want to =E2=80=9Cpush downstream=E2=80=9D the set included in severa=
l derivative=20
standardization efforts.

=20

   - Lev=20


On Wednesday, March 29, 2017 at 7:04:35 AM UTC-4, Beman Dawes wrote:
>
>
>
> On Sat, Mar 4, 2017 at 1:32 PM, <l...@compuserve.com <javascript:>> wrote=
:
>
>>
>>
>> *Hello everyone,        Many areas of software development where C++ is=
=20
>> actively used involve mathematical calculations. The language inherited =
a=20
>> sizable math function library from C, and now has its own numerics libra=
ry=20
>> that grows with every release. There is however a small but annoying=20
>> omission: C++ standard headers do not include definitions of mathematica=
l=20
>> constants. To this math major it appears to be a very strange gap: where=
ver=20
>> common mathematical functions are used, the constants such as  =CF=80 or=
 e=20
>> appear quite frequently. Yes, it is not terribly difficult to define a=
=20
>> constant, but from the C++ user's perspective this is as if they were=20
>> served a dish at a restaurant but asked to bring their own salt. *
>>
>
> Hi Lev,
>
> Are you aware of=20
> www.boost.org/doc/libs/1_63_0/libs/math/doc/html/constants.html ?
>
> IIRC, development of a truly useful library of C++ math functions was far=
=20
> more complex than anyone would have guessed at the onset, and took severa=
l=20
> years of effort. You might want to talk to John Maddock, Paul Bristow,=20
> and Christopher Kormanyos first.
>
> --Beman
>
>

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/582b35dc-0a1b-4a3e-92bc-881a1ef2d946%40isocpp.or=
g.

------=_Part_165_1484881662.1490787250753
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><p class=3D"MsoNormal"><font size=3D"2" face=3D"Calibri"><=
span style=3D"font-size:11.0pt;
font-family:&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin=
;mso-hansi-theme-font:
minor-latin;mso-bidi-font-family:&quot;Times New Roman&quot;;mso-bidi-theme=
-font:minor-bidi">Hi
Beman,<o:p></o:p></span></font></p>

<p class=3D"MsoNormal"><font size=3D"2" face=3D"Calibri"><span style=3D"fon=
t-size:11.0pt;
font-family:&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin=
;mso-hansi-theme-font:
minor-latin;mso-bidi-font-family:&quot;Times New Roman&quot;;mso-bidi-theme=
-font:minor-bidi"><o:p>=C2=A0</o:p></span></font></p>

<p class=3D"MsoNormal"><font size=3D"2" face=3D"Calibri"><span style=3D"fon=
t-size:11.0pt;
font-family:&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin=
;mso-hansi-theme-font:
minor-latin;mso-bidi-font-family:&quot;Times New Roman&quot;;mso-bidi-theme=
-font:minor-bidi">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 Thank you for your message. Yes, I
am aware of the good work that Boost contributors have done on Boost consta=
nts.
It doesn=E2=80=99t surprise me that math functions are difficult to impleme=
nt in a true
cross-platform and computationally stable way. I spoke with Paul Bristow vi=
a
email and got some useful feedback from him. <o:p></o:p></span></font></p>

<p class=3D"MsoNormal"><font size=3D"2" face=3D"Calibri"><span style=3D"fon=
t-size:11.0pt;
font-family:&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin=
;mso-hansi-theme-font:
minor-latin;mso-bidi-font-family:&quot;Times New Roman&quot;;mso-bidi-theme=
-font:minor-bidi"><o:p>=C2=A0</o:p></span></font></p>

<p class=3D"MsoNormal"><font size=3D"2" face=3D"Calibri"><span style=3D"fon=
t-size:11.0pt;
font-family:&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin=
;mso-hansi-theme-font:
minor-latin;mso-bidi-font-family:&quot;Times New Roman&quot;;mso-bidi-theme=
-font:minor-bidi">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 The goal of my proposal is far more
narrow. I focus specifically on constants, and explicitly state that severa=
l aspects
of their implementation should be left up to the implementer=E2=80=99s disc=
retion. It
is not my intent at all to compile a comprehensive set of math constants. I
merely want to =E2=80=9Cpush downstream=E2=80=9D the set included in severa=
l derivative standardization
efforts.<o:p></o:p></span></font></p>

<p class=3D"MsoNormal"><font size=3D"2" face=3D"Calibri"><span style=3D"fon=
t-size:11.0pt;
font-family:&quot;Calibri&quot;,sans-serif;mso-ascii-theme-font:minor-latin=
;mso-hansi-theme-font:
minor-latin;mso-bidi-font-family:&quot;Times New Roman&quot;;mso-bidi-theme=
-font:minor-bidi"><o:p>=C2=A0</o:p></span></font></p>

<ul style=3D"margin-top:0in" type=3D"disc">
 <li class=3D"MsoListParagraph" style=3D"margin-left:.25in;mso-list:l0 leve=
l1 lfo1"><font size=3D"2" face=3D"Calibri"><span style=3D"font-size:11.0pt;=
font-family:&quot;Calibri&quot;,sans-serif;
     mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;
     mso-bidi-font-family:&quot;Times New Roman&quot;;mso-bidi-theme-font:m=
inor-bidi">Lev<o:p></o:p></span></font></li>
</ul><br>On Wednesday, March 29, 2017 at 7:04:35 AM UTC-4, Beman Dawes wrot=
e:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;b=
order-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><br><div><b=
r><div class=3D"gmail_quote">On Sat, Mar 4, 2017 at 1:32 PM,  <span dir=3D"=
ltr">&lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D=
"RSpX3Xn_BwAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;javascript:=
&#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;return tru=
e;">l...@compuserve.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail=
_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204=
,204);padding-left:1ex"><div dir=3D"ltr"><div><b><div>Hello everyone,</div>=
<div><br></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 Many areas of software deve=
lopment where C++ is actively used involve mathematical calculations. The l=
anguage inherited a sizable math function library from C, and now has its o=
wn numerics library that grows with every release. There is however a small=
 but annoying omission: C++ standard headers do not include definitions of =
mathematical constants. To this math major it appears to be a very strange =
gap: wherever common mathematical functions are used, the constants such as=
 =C2=A0=CF=80 or e appear quite frequently. Yes, it is not terribly difficu=
lt to define a constant, but from the C++ user&#39;s perspective this is as=
 if they were served a dish at a restaurant but asked to bring their own sa=
lt.=C2=A0</div><div><br></div></b></div></div></blockquote><div><br></div><=
div>Hi Lev,</div><div><br></div><div>Are you aware of <a href=3D"http://www=
..boost.org/doc/libs/1_63_0/libs/math/doc/html/constants.html" target=3D"_bl=
ank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;http://www.google.com=
/url?q\x3dhttp%3A%2F%2Fwww.boost.org%2Fdoc%2Flibs%2F1_63_0%2Flibs%2Fmath%2F=
doc%2Fhtml%2Fconstants.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFTc9odm=
Y4-0UJYDjIqoPXGRK2DHg&#39;;return true;" onclick=3D"this.href=3D&#39;http:/=
/www.google.com/url?q\x3dhttp%3A%2F%2Fwww.boost.org%2Fdoc%2Flibs%2F1_63_0%2=
Flibs%2Fmath%2Fdoc%2Fhtml%2Fconstants.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x=
3dAFQjCNFTc9odmY4-0UJYDjIqoPXGRK2DHg&#39;;return true;">www.boost.org/doc/l=
ibs/1_63_0/<wbr>libs/math/doc/html/constants.<wbr>html</a>=C2=A0?</div><div=
><br></div><div>IIRC, development of a truly useful library of C++ math fun=
ctions was far more complex than anyone would have guessed at the onset, an=
d took several years of effort. You might want to talk to John Maddock, Pau=
l Bristow, and=C2=A0Christopher Kormanyos first.</div><div><br></div><div>-=
-Beman</div></div><br></div></div>
</blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/582b35dc-0a1b-4a3e-92bc-881a1ef2d946%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/582b35dc-0a1b-4a3e-92bc-881a1ef2d946=
%40isocpp.org</a>.<br />

------=_Part_165_1484881662.1490787250753--

------=_Part_164_1067762707.1490787250753--

.