This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: numeric_limits<char>::digits = 7 ?
- To: "R. Sinoradzki" <sinoradz at student dot uni-kl dot de>
- Subject: Re: numeric_limits<char>::digits = 7 ?
- From: Gabriel Dos Reis <Gabriel dot Dos-Reis at cmla dot ens-cachan dot fr>
- Date: 03 May 2001 16:46:29 +0200
- Cc: libstdc++ at gcc dot gnu dot org
- Organization: CMLA, ENS Cachan -- CNRS UMR 8536 (France)
- References: <3AF167B3.AB70306B@student.uni-kl.de>
"R. Sinoradzki" <sinoradz@student.uni-kl.de> writes:
| Hi,
|
| I want to use a bitset to store a double.
|
| So I tried bitset< numeric_limits<char>::digits * sizeof(double) >.
|
| Then I noticed, that numeric_limits<char>::digits is set to 7.
| This is different from CHAR_BIT = 8 in <climits>.
| What is the reason to use different values?
For T = builtin-type, numeric_limits<T>::digits the number of non-sign
bits in the representation. See 18.2.1.2/7.
For example std::numeric_limits<unsigned char>::digits is 8.
-- Gaby