Boost logo

Boost :

From: Paul A Bristow (pbristow_at_[hidden])
Date: 2005-05-06 13:16:43

I have recently posted to the Boost Sandbox vault an update of my collection
of mathematical constants,
previously reviewed as a Boost library and ultimately not accepted because
lack of agreement on how to present the constants, especially for User
Defined Types,
and an outbreak of macrophobia.

However the values are still valid and some may find them a useful and
convenient source,
with even more reassuringly sufficient decimal places to give you a warm
feeling ;-)

The values are take from Internet sources and then computed with NTL a
arbitrary (very high) precision library
and presented as 40 decimal digit strings, suitable for all hardware as yet
I have tried to check as many as possible against two source to try to avoid
but please tell me of any that you find.

The same values are actually presented in header files as macros, floats,
doubles, and long doubles,
(and also as the functions allowing pi to call a function pi() proposed by
Michael Kenniston,
even though I am not entirely convinced of their usefulness).

So including double_constants.hpp will give lots of values, for example:

static const double cubeRootTwo = 1.25992104989487316476721060727822835057;
// 2^1/3

If you prefer a macro, the define_constants.h will give you values like

#define M_EPOWPI 23.14069263277926900572908636794854738027L /* e^pi */

You can of course also cut and paste invididual lines, if you just want pi.

No choice of names will suit everyone - so I have indulged myself.

You can change them of course.

for two zips of headers and documentation as html.



PS Some of these values are to be used in the math functions for stats
that I am in danger of getting around to Real Soon Now.

Paul A Bristow
Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB
+44 1539 561830 +44 7714 330204
mailto: pbristow_at_[hidden]

Boost list run by bdawes at, gregod at, cpdaniel at, john at