
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Thorsten Ottosen Sent: 30 January 2009 12:34 To: boost@lists.boost.org Subject: Re: [boost] Numeric constants
Paul A. Bristow skrev:
My question is - what precision would be useful?
I assume float, double and long double will be supported? These seems to be the ones we need for the new bounded_float class from the ContrainedValue lib recently reviewed.
Yes by having three extra namespaces: namespace boost::math::float_constants; namespace boost::math::double_constants; namespace boost::math::long_double_constants; used like this: float circumference(float r) { using namespace boost::math::float_constants; return 2 * pi * r; } and double circumference(double r) { using namespace boost::math::double_constants; return 2 * pi * r; } Similarly long double. Would this fit with the new bounded_float classes from the ContrainedValue library? But I was asking about the maximum possible precision for the underlying constants - that you might want to use with an arbitrary precision type, 'BigFloats' like NTL, GMP etc. As John has shown with the Math library, there are times when you need this to generate reference values, more accurate than built-in types, to be sure that you get exactly the right built-in value. Paul --- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com