libstdc++/5045: wrong value std::numeric_limits<T>::digits10 for integer types

pmartin@uklinux.net pmartin@uklinux.net
Fri Dec 7 12:31:00 GMT 2001


>Number:         5045
>Category:       libstdc++
>Synopsis:       wrong value std::numeric_limits<T>::digits10 for integer types
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 07 12:06:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     pmartin@uklinux.net
>Release:        3.0.3 and 3.1
>Organization:
>Environment:
Reading specs from /usr/local/gcc-3.0-cvs/lib/gcc-lib/i686-pc-linux-gnu/3.0.3/sp
ecs
Configured with: /home/pm/sw/gcc-3.0-cvs/gcc/configure --prefix=/usr/local/gcc-3
.0-cvs --enable-languages=c++ --enable-threads
Thread model: posix
gcc version 3.0.3 20011030 (prerelease)


Reading specs from /usr/local/gcc-head/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: /home/pm/sw/gcc-head/gcc/configure --prefix=/usr/local/gcc-head
 --enable-languages=c++ --enable-threads
Thread model: posix
gcc version 3.1 20011207 (experimental)
>Description:
The values of digits10 in bits/std_limits.h for most of the integer types
are out by one. For example the 8-bit signed value is

#define __glibcpp_s8_digits10 3

but only 2 decimal digits can be represented without change.

The values for signed and unsigned 8, 16 and 32 bits are all one
too large, as is signed 64 bits.  Note that unsigned 64 bits is 
OK, probably by accident, since 2^64 provides one more decimal 
than 2^63.

>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list