Commit 77bd447b by Paolo Carlini Committed by Paolo Carlini

re PR libstdc++/8949 (numeric_limits<>::denorm_min() and is_iec559 problems.)

2002-12-16  Paolo Carlini  <pcarlini@unitus.it>

	PR libstdc++/8949
	* include/std/std_limits.h
	(struct numeric_limits<short>,
	struct numeric_limits<unsigned short>,
	struct numeric_limits<int>,
	struct numeric_limits<unsigned int>,
	struct numeric_limits<long>,
	struct numeric_limits<unsigned long>,
	struct numeric_limits<long long>,
	struct numeric_limits<unsigned long long>): According
	to 18.2.1.2,53 and 18.2.1.5,1 is_iec559 shall be false.
	* testsuite/18_support/numeric_limits.cc: Add test04.

From-SVN: r60181
parent 165bfb59
2002-12-16 Paolo Carlini <pcarlini@unitus.it>
PR libstdc++/8949
* include/std/std_limits.h
(struct numeric_limits<short>,
struct numeric_limits<unsigned short>,
struct numeric_limits<int>,
struct numeric_limits<unsigned int>,
struct numeric_limits<long>,
struct numeric_limits<unsigned long>,
struct numeric_limits<long long>,
struct numeric_limits<unsigned long long>): According
to 18.2.1.2,53 and 18.2.1.5,1 is_iec559 shall be false.
* testsuite/18_support/numeric_limits.cc: Add test04.
2002-12-16 Benjamin Kosnik <bkoz@redhat.com> 2002-12-16 Benjamin Kosnik <bkoz@redhat.com>
* configure.in (GLIBCPP_ENABLE_DEBUG): Default to none. * configure.in (GLIBCPP_ENABLE_DEBUG): Default to none.
......
...@@ -508,7 +508,7 @@ namespace std ...@@ -508,7 +508,7 @@ namespace std
static short denorm_min() throw() static short denorm_min() throw()
{ return short(); } { return short(); }
static const bool is_iec559 = true; static const bool is_iec559 = false;
static const bool is_bounded = true; static const bool is_bounded = true;
static const bool is_modulo = true; static const bool is_modulo = true;
...@@ -558,7 +558,7 @@ namespace std ...@@ -558,7 +558,7 @@ namespace std
static unsigned short denorm_min() throw() static unsigned short denorm_min() throw()
{ return static_cast<unsigned short>(0); } { return static_cast<unsigned short>(0); }
static const bool is_iec559 = true; static const bool is_iec559 = false;
static const bool is_bounded = true; static const bool is_bounded = true;
static const bool is_modulo = true; static const bool is_modulo = true;
...@@ -608,7 +608,7 @@ namespace std ...@@ -608,7 +608,7 @@ namespace std
static int denorm_min() throw() static int denorm_min() throw()
{ return static_cast<int>(0); } { return static_cast<int>(0); }
static const bool is_iec559 = true; static const bool is_iec559 = false;
static const bool is_bounded = true; static const bool is_bounded = true;
static const bool is_modulo = true; static const bool is_modulo = true;
...@@ -658,7 +658,7 @@ namespace std ...@@ -658,7 +658,7 @@ namespace std
static unsigned int denorm_min() throw() static unsigned int denorm_min() throw()
{ return static_cast<unsigned int>(0); } { return static_cast<unsigned int>(0); }
static const bool is_iec559 = true; static const bool is_iec559 = false;
static const bool is_bounded = true; static const bool is_bounded = true;
static const bool is_modulo = true; static const bool is_modulo = true;
...@@ -708,7 +708,7 @@ namespace std ...@@ -708,7 +708,7 @@ namespace std
static long denorm_min() throw() static long denorm_min() throw()
{ return static_cast<long>(0); } { return static_cast<long>(0); }
static const bool is_iec559 = true; static const bool is_iec559 = false;
static const bool is_bounded = true; static const bool is_bounded = true;
static const bool is_modulo = true; static const bool is_modulo = true;
...@@ -758,7 +758,7 @@ namespace std ...@@ -758,7 +758,7 @@ namespace std
static unsigned long denorm_min() throw() static unsigned long denorm_min() throw()
{ return static_cast<unsigned long>(0); } { return static_cast<unsigned long>(0); }
static const bool is_iec559 = true; static const bool is_iec559 = false;
static const bool is_bounded = true; static const bool is_bounded = true;
static const bool is_modulo = true; static const bool is_modulo = true;
...@@ -808,7 +808,7 @@ namespace std ...@@ -808,7 +808,7 @@ namespace std
static long long denorm_min() throw() static long long denorm_min() throw()
{ return static_cast<long long>(0); } { return static_cast<long long>(0); }
static const bool is_iec559 = true; static const bool is_iec559 = false;
static const bool is_bounded = true; static const bool is_bounded = true;
static const bool is_modulo = true; static const bool is_modulo = true;
...@@ -858,7 +858,7 @@ namespace std ...@@ -858,7 +858,7 @@ namespace std
static unsigned long long denorm_min() throw() static unsigned long long denorm_min() throw()
{ return static_cast<unsigned long long>(0); } { return static_cast<unsigned long long>(0); }
static const bool is_iec559 = true; static const bool is_iec559 = false;
static const bool is_bounded = true; static const bool is_bounded = true;
static const bool is_modulo = true; static const bool is_modulo = true;
......
...@@ -289,12 +289,33 @@ bool test03() ...@@ -289,12 +289,33 @@ bool test03()
return test; return test;
} }
// libstdc++/8949
bool test04()
{
bool test = true;
VERIFY( !std::numeric_limits<short>::is_iec559 );
VERIFY( !std::numeric_limits<unsigned short>::is_iec559 );
VERIFY( !std::numeric_limits<int>::is_iec559 );
VERIFY( !std::numeric_limits<unsigned int>::is_iec559 );
VERIFY( !std::numeric_limits<long>::is_iec559 );
VERIFY( !std::numeric_limits<unsigned long>::is_iec559 );
VERIFY( !std::numeric_limits<long long>::is_iec559 );
VERIFY( !std::numeric_limits<unsigned long long>::is_iec559 );
#ifdef DEBUG_ASSERT
assert(test);
#endif
return test;
}
int main() int main()
{ {
test01(); test01();
test02(); test02();
test03(); test03();
test04();
test_extrema<char>(); test_extrema<char>();
test_extrema<signed char>(); test_extrema<signed char>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment