Boost logo

Boost :

From: boost (boost_at_[hidden])
Date: 2001-04-19 05:39:56


Salut,

On Thursday 19 April 2001 00:00, you wrote:
[...]
> - Naively I was expecting something like:
>
> namespace boost {
> namespace math {
> namespace F {
> const float pi = 3.14159265358979323846264338327950288F;
> //...
> }
> namespace D {
> const double pi = 3.14159265358979323846264338327950288;
> //...
> }
> namespace L {
> const long double pi = 3.14159265358979323846264338327950288L;
> //...
> }
> template <typename T> // just for the idea, details might need
> work
> pi(const T&) { return boost::math::L::pi; }
> //...
> }
> }
[...]
I would prefer this too, without any macros.
Maybe one should spend a few letters, sinf L could also refer to long int,
e.g. namespace Float{ ...

or

.h:

using namespace std;

namespace boost
{
    namespace math
    {
        template <typename T> class Constants
        {
                static const T pi;
                static const T e;
        };
    }
};

const double boost::math::Constants<double>::pi = 3.1415;
const interval<double>
         boost::math::Constants<interval<double> >::pi = ( 3.1415, 0.0001);

In addition, dear Paul Bristow,

#define BOOST_CF 1.03064083410071293588177609411693684L /* Continued fraction
(base 10) */

could you please explain this constant.

Best wishes
Peter


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk