This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] libstdc++/5045: wrong numeric_limits::digits10 forinteger types
Nathan Myers wrote:
> On Sat, Dec 08, 2001 at 01:37:46AM +0100, Paolo Carlini wrote:
> > Benjamin Kosnik wrote:
> >
> > > > May I apply the following patch?
> > > Please wait for Gaby to ok and make a test case please.
> > In case Gaby ok the patch this is what I propose for the testsuite.
> > + VERIFY( __glibcpp_s8_digits10 == 2 );
> > + VERIFY( __glibcpp_u8_digits10 == 2 );
> > + VERIFY( __glibcpp_s16_digits10 == 4 );
> > + VERIFY( __glibcpp_u16_digits10 == 4 );
> > + VERIFY( __glibcpp_s32_digits10 == 9 );
> > + VERIFY( __glibcpp_u32_digits10 == 9 );
> > + VERIFY( __glibcpp_s64_digits10 == 18 );
>
> I agree that Paolo's changes are correct, according to the
> spirit of LAI-1 that numeric_traits is based on. I recommend
> we go ahead and commit.
Thanks Nathan. I will wait just a little bit more for Gaby, then will commit.
> Do we have a u64 == 19 case?
In fact, 2^64-1 is about 1.844e+19, so the current value in std_limits.h is correct as is
(by "chance" we could say).
Do you think I should include it in the testcase??
Cheers,
Paolo.