
Boost : 
From: k.hagan_at_[hidden]
Date: 20010424 05:13:11
Peter Schmitteckert asks if there is a boost interval library.
Yes, Jens Maurer submitted one over a year ago, but it is sitting
in the vault because people like me haven't got around to doing
anything with it. I would expect a good interval library to replace
the use of plain float & double, in the same way that std::string
has (?) replaced char[]. (We only need to convince the performance
freaks that there is little or no cost involved.)
Paul Bristow asks if an interval pi could be obtained by taking
the boost constant and adding plusorminus epsilon. As long as
the interval class's own "directed rounding" arithmetic were used,
this would work but it would give an interval that was too wide.
You only need to add/subtract the smallest representable floating
point value. However, you do need to start with the closest
representable value for pi. Since we cannot rely on our compiler
to provide this, no matter how many digits we offer, I conclude
that the interval library would have to provide a specialisation
of the maths constants.
I second Herve Bronnimann's view that many users will turn to
boost::constant precisely because they do want the most accurate
possible value, but both Constant and Interval libraries are
like the functions in <math>. They cannot be both fully portable
and fully accurate. (Indeed, this would be the reason to put them
into std:: at some point.)
Therefore, as Matt Austern suggests, the most important thing now
is to define an interface that can be implemented in the optimal
way for any given platform. Would it help our search for this
interface if people offered platformspecific implementations?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk