From: Paul A Bristow (pbristow_at_[hidden])
Date: 2005-05-15 12:48:25
I have just returned from a
"well-earned ;-)" holiday
to see many have responded
to my post about math constants.
Thanks for all your interest and suggestions.
Can I respond with a few comments:
1 There is VIOLENT opposition to requiring pi().
You may not like it, but there IS!
I am sympathetic to this view -
many equations are complex enough with yet more bracket clutter.
This is why Walter Brown is pushing for a C++0X change
to avoid the ()s, and I think it will probably happen.
2 Daniel Frey's suggestions look most promising,
but they just don't work portably - yet.
There are now C++0X language typeof proposals
and Boost typeof kludges. If he can get it to work using
these for the main recent compilers, I'll happily produce
(Or Daniel could use the greatly despised macro values,
and the undefines to erase all traces of macro names.
This is anexample of why I have included these two files:
if they offend you, don't use them!).
3 Before you get TOO excited about further calculated values,
don't forget that you _can't_ just use the compiler to evaluate
the expressions and be sure of the most accurate results.
This is especially true for pow, sqrt, log, exp which are
usually several 'bits' wrong.
This is why using a higher accuracy system
is still a good idea to get the most accurate and
most usefully in practice, the most _consistent_ value,
and so the most _portable_ value.
4 I concluded from the previous review that we could never agree
until the language problems are resolved (or worked round).
5 Don't also forget the desirability of including the
smallest intervals which include values, to allow use
with the existing Boost interval library.
These have the additional complication of being floating-point format
Meanwhile, I hope some will find the sandbox values useful
taking them in whichever format offends you least!
I suspect 95% of people will find #include double_constants.hpp
will meet 99% of their needs.
I also suspect that many people will simple copy and paste the
single line defining the value that they need.
Paul A Bristow
Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB
+44 1539 561830 +44 7714 330204
| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]] On Behalf Of Deane Yang
| Sent: 10 May 2005 18:37
| To: boost_at_[hidden]
| Subject: [boost] Re: Math constants - updated.
| I very much appreciate Daniel's efforts on this, but I do get the
| impression that it still needs more testing and tweaking.
| Couldn't boost first accept a constants library that has an
| easier-to-implement modern C++ interface (parentheses and
| all), so that
| we can all start using it sooner rather than later, and then
| Daniel's interface at a later date?
| Daniel Frey wrote:
| > Andy Little wrote:
| >>"Tobias Schwinger" <tschwinger_at_[hidden]> wrote
| >>>Btw. Daniel Frey's library looks very interesting - did you take a
| >>>look at it
| Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk