|
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-08 12:45:23
> -----Original Message-----
> From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]] On Behalf Of John
> Maddock
> Sent: Wednesday, June 08, 2011 5:05 PM
> To: boost_at_[hidden]
> Subject: Re: [boost] MS VC10 std::numeric_limits<float>::max_digits10 iswrong for float
>
> > Assuming I am right, I think this means that we need yet another macro
> > (Groans and Cries of Oh No, not another!)
> >
> > because
> >
> > BOOST_NO_NUMERIC_LIMITS_LOWEST
> >
> > not defined is no longer an indicator that
> >
> > max_digits10 is available (and its values correct).
> >
> > So do we need
> >
> > BOOST_NO_NUMERIC_LIMITS_MAX_DIGITS10
> >
> > which should be defined by default, and only undefined for those
> > libraries supporting C++0X std::numeric_limits with correct values
> > like recent GCC - and others (but not <= VC10)?
> >
> > Views?
>
> Sigh.... I guess so. Care to submit a patch?
in dinkumware.hpp I think it should be
// C++0x headers implemented in 520 (as shipped by Microsoft)
(assuming 520 is the version shipped with VC10 and that VC11 will correct and bump _CPPLIB_VER ?)
Note _CPPLIB_VER <= rather than < 520 for other similar macros
#if !defined(_CPPLIB_VER) || _CPPLIB_VER <= 520
# define BOOST_NO_NUMERIC_LIMITS_ MAX_DIGITS10
#endif
but there are many other compilers' config files and I'm not clear which versions implement C++0X
and thus presumably max_digits10 - and if anyone else has had a mental aberration/fat finger?
What I'm expecting people to be able to write is something like
int max_digits10;
#ifdef BOOST_NO_NUMERIC_LIMITS_ MAX_DIGITS10
max_digits10 = 2 + std::numeric_limits<FPT>::digits * 3010/10000;
#else
max_digits10 = std::numeric_limits<FPT>::max_digits10;
#endif
Paul
--- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk