 Original Message
 From:
[hidden email]
 [mailto:
[hidden email]] On Behalf Of Victor A.
 Wagner Jr.
 Sent: 10 February 2006 06:08
 To:
[hidden email];
[hidden email]
 Subject: Re: [boost] Boost test  displaying float point numbers

 At 15:19 20060209, Paul A Bristow wrote:
 >Some of you have noted (with displeasure) the ugly display
 of floating point
 >values from
 >
 >BOOST_CHECK_CLOSE
 >
 >for example
 >
 >difference between +1e6{9.9999999999999995e007} and
 >1e5{1.0000000000000001e005} exceeds 2.22045e018%
 >
 >The number of decimal digits used is enough to show all that can be
 >significant.
 >
 >For 64bit doubles it is 17 decimal digits, (for 32bit
 float 9) and for
 >long double, quad_float even more.

 I don't see where you're getting your # of digits
 my calculations show that it's around 14 for 64bit floating and
 around 7 for 32bit
 numeric_limits<>::digits10 shows 6 for float, 15 for double on vc8
>From formula given by Kahan, inventor of IEEE754, so he should know!
http://http.cs.berkeley.edu/~wkahan/ieee754status/IEEE754.PDFPage 4
and this was proposed
http://www2.openstd.org/JTC1/SC22/WG21/docs/papers/2005/n1822.pdfand found favour with WG14 so may well be part of TR2.
Note that the number of digits required to show all possibly significant
digits
which I have called max_digits10 (and
and as max significant digits MACROs for C N1151 to WG14
FLT_DIG 6, FLT_MAXDIG10 9
DBL_DIG 15, DBL_MAXDIG10 17
LDBL_DIG 19, LDBL_MAXDIG10 21
is 2 or 3 more than numeric_limits<>::digits10 which is effectively the
numerb that are guranteed correct  after being rounded.
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:
[hidden email] http://www.hetp.unet.com/index.htmlhttp://www.hetp.unet.com/Paul%20A%20Bristow%20info.html_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost