From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2001-04-23 10:08:45
There is nothing secret or difficult about the program for generating these
constants (though setting up the NTL library involves some work).
I will include it in the vault if BOOSTERS think this useful.
You DO need some program like this that works at MORE than quad_precision
(128-bit) to get a accurate quad_precision, plus anti-rounding error digits,
- nothing that the compiler will do is sufficiently accurate.
While * or / 2 is a special case of being exact, in general it is
better to use a accurately pre-computed value.
So for example, I will add four_thirds_pi for completeness
(though it CAN be calculated from one_third_pi)
> -----Original Message-----
> From: Herve Bronnimann [mailto:herve_at_[hidden]]On Behalf Of
> Herve Bronnimann
> Sent: Friday, April 20, 2001 10:19 PM
> To: Matt Austern
> Cc: boost_at_[hidden]
> Subject: [boost] Re: Boost.MathConstants: Review
> Side note: it doesn't solve the case of a user doing things like
> double two_pi = 2.0 * boost::mathconstants<double>::pi();
> So if you have a short program that generates those numbers (perhaps a
> C++ template meta-code, although it's hard to imagine how to do THAT)
> it would be best if you include it in the distribution for users who
> care to be able to derive their own constants...
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk