Unclear specification of numeric_limits
Hello,
neither in 14882:2003(E) nor in N2135 nor in the library issues lists
I could find a
definite answer to the following questions:
1) Which kind of representation (value representation or object
representation) is
meant in numeric_limits<>::digits for integer types? I assume value
representation,
but I'm not sure whether this is guaranteed: 18.2.1.2 says in paras 6
and 7:
"Number of radix digits that can be represented without change.
For built-in integer types, the number of non-sign bits in the
representation."
Besides the proper nomenclature ("built-in"), which is already
questioned by other
issues, I can't deduce from this explanation, whether we speek of
object or value
"bits" here.
2) From the current state of N2135 I deduce, that proper
specializations of the
std::numeric_limits template must also be provided for the possible
extended
integer types (3.9.1 p.2 and p.3). This should be true independent on
the interpretation
whether numeric_limits should be given for either fundamental or
arithmetic types,
because the extended integer types belong to the family of integer
(integral) types
which are both fundamental and arithmetic types (C.f.
http://www2.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#201).
If this is true, shouldn't then the Header <limits> synopsis (18.2.1
p. 4) be extended
to follow this interpretation? I suggest to add on further line as
done in the following
snippet:
"namespace std {
template<class T> class numeric_limits;
enum float_round_style;
enum float_denorm_style;
template<> class numeric_limits<bool>;
[..]
template<> class numeric_limits<long double>;
... // Further specializations for each extended integer type
}
"
Greetings from Bremen,
Daniel Kr?gler
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]