[PATCH] libstdc++/5045: wrong numeric_limits::digits10 for integer types
Gabriel Dos Reis
gdr@codesourcery.com
Wed Dec 12 02:52:00 GMT 2001
Paolo Carlini <pcarlini@unitus.it> writes:
| Gabriel Dos Reis wrote:
|
| > Benjamin Kosnik <bkoz@redhat.com> writes:
| >
| > | > May I apply the following patch?
| > |
| > | Please wait for Gaby to ok and make a test case please.
| >
| > [ Apologies for the late reply. I've been kept away from GCC for some
| > good reasons ;-) ]
| >
| > The patch is OK. Thanks.
|
| Thanks Gaby for your awaited feedback. May I assume that you are
| approving the *final* version of the patch, that appearing in:
|
| http://gcc.gnu.org/ml/libstdc++/2001-12/msg00184.html
Well, this area is one the fuzziest area of numeric_limits<>.
>From the standard point of view any number can be represented
exactly as a bool given the mapping (zero |-> false, nonzero |-> true).
As such, I think numeric_limits<unsigned long>::digits10 is a valid
value, but that is just being pedantic.
>From my point of view, there is a defect to raise:
numeric_limits<bool>::digits10 is meaningless.
For the meantime, yes you can apply the final version.
-- Gaby
More information about the Libstdc++
mailing list