Boost logo

Boost :

Subject: Re: [boost] Boost.Math and Math Constants
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2011-12-07 14:13:50


On Wed, Dec 7, 2011 at 9:11 AM, John Maddock <boost.regex_at_[hidden]> wrote:

> using boost::math::double_constants;
>>> double area = pi * r * r;
>>>
>>> and users can read the equations easily.
>>>
>>> (Float and long double are similarly available in their own namespaces).
>>>
>>>
>> It seems like this isn't a huge improvement over
>>
>> double const pi = boost::math::constants::pi< double >();
>> double area = pi * r * r;
>>
>
> As a dyed in the wool C++'er I'd agree.
>
> But a previous review of a MathConstants lib by Paul failed because folks
> got very hot under the collar about this. Some folks needed constants that
> could be used in generic code, others were of the "over my dead body unless
> it's a constant variable in a header" persuasion. So we made both
> available. So <shrug> I guess.
>
> Hoping to avoid the flame wars this time around yours, John ;-)
>

++<shrug>, then

- Jeff


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