Boost logo

Boost :

From: Paul A Bristow (pbristow_at_[hidden])
Date: 2005-12-03 07:31:05


| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]] On Behalf Of John Maddock
| Sent: 02 December 2005 19:45
| To: boost_at_[hidden]
| Subject: Re: [boost] [math] floating point classification -
| testinghelpwanted
|
| >> I'm not sure that epsilon has a exactly defined value but
| I concluded
| >>
| >> static quad_float epsilon() throw() { return
| >> 2.4651903288156618919116517665087069677288E-32;}; // 2^(1-106) ==
| >> 2^105
| >>
| >> was my best guess.
|
| Normally it should be std::pow(two, 1-std::numeric_limits<T>::digits), so
| your value sounds about right (you can also use ldexp(1.0,exponent)
| to achieve the same thing a little more efficiently).

Yes - but I was hoping that this value would be computed at compile time,
whereas ldexp would only be used at runtime?

| On Darwin numeric_limits<>::epsilon returns something like
| 10^-303 which is
| the same as the value for numeric_limts<>::min() I believe.
| It's just plain crazy, all IMO of course :-)

Sounds wrong to me too.

But it wouldn't be the first time <limits> values have been dodgy ;-)

Paul

-- 
Paul A Bristow
Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB
Phone and SMS text +44 1539 561830, Mobile and SMS text +44 7714 330204
mailto: pbristow_at_[hidden]  http://www.hetp.u-net.com/index.html
http://www.hetp.u-net.com/Paul%20A%20Bristow%20info.html

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