Boost logo

Boost :

From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2001-04-24 12:31:58

> -----Original Message-----
> From: k.hagan_at_[hidden] [mailto:k.hagan_at_[hidden]]
> Sent: Tuesday, April 24, 2001 11:13 AM
> To: boost_at_[hidden]
> Subject: [boost] Re: Boost.MathConstant (& Boost.Interval)
> Paul Bristow asks if an interval pi could be obtained by taking
> the boost constant and adding plus-or-minus 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 agree add/subtract smallest representable floating
point value (epsilon) would be overly pessimistic.

I have now studied William D Clinger "How to read Floating Point Numbers
a bit more carefully.

I draw some comfort from the last paragraph in section 1 Introduction

"By choosing a large enough extended precision, the pobability that an even
greter precision will be needed can be made as small as possible.

For IEEE double precision numbers, an experiment reported in section 9 found
that IEEE extended precision is enough to find the best approximation over
99% of the time"

and details of the experiment in Section 9.

So I conclude we should not worry too much about this in practice,
but not guarantee the the long double is the closest representable value f,
but within + or - epsilon?


Dr Paul A Bristow, hetp Chromatography
Prizet Farmhouse
Kendal, Cumbria
+44 1539 561830

Boost list run by bdawes at, gregod at, cpdaniel at, john at