Boost logo

Boost :

Subject: Re: [boost] MS VC10 std::numeric_limits<float>::max_digits10 iswrong for float
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2011-06-15 04:28:43

> -----Original Message-----
> From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]] On Behalf Of Mathias
> Gaunard
> Sent: Tuesday, June 14, 2011 10:46 PM
> To: boost_at_[hidden]
> Subject: Re: [boost] MS VC10 std::numeric_limits<float>::max_digits10 iswrong for float
> On 12/06/2011 17:38, Paul A. Bristow wrote:
> > or we have to stick to the Kahan formula for yet another year :-(
> > (Reluctantly, I'm coming to be view that the latter is the easiest
> > thing to do, since there are so many compilers/libraries to deal with,
> > making config a rats nest.)
> Exactly what are the advantages of not doing so?

Using the constant numeric_limits<FPT>::max_digits10 is absolutely clear to the reader, and may be
more efficient.

Using the Kahan formula is obscure to the non-cognoscenti, and may not be compiled so efficiently.

Defining yet another Boost macro in config files is quite a bit of trouble, carries some risk of a

Using a Boost macro that tests for a C++0X library and uses Kahan formula if not, is messy, but at
least the meaning of the code is clear because the C++0X path specifies max_digits10.

The bottom line is that digits10 was never what most people want and should have been max_digits10
to start with :-)

The line of least effort is to wait for MS to correct the value.


Paul A. Bristow,
Prizet Farmhouse, Kendal LA8 8AB  UK
+44 1539 561830  07714330204

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