Author: sebor
Date: Thu Jan 11 14:07:07 2007
New Revision: 495402
URL: http://svn.apache.org/viewvc?view=rev&rev=495402
Log:
2007-01-11 Martin Sebor <[EMAIL PROTECTED]>
* limits.cpp (operator<<): New overload for std::float_denorm_style.
(print_limits): Called it for numeric_limits<T>::has_denorm.
* limits.out: Adjusted accordingly.
Modified:
incubator/stdcxx/trunk/examples/manual/limits.cpp
incubator/stdcxx/trunk/examples/manual/out/limits.out
Modified: incubator/stdcxx/trunk/examples/manual/limits.cpp
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/examples/manual/limits.cpp?view=diff&rev=495402&r1=495401&r2=495402
==============================================================================
--- incubator/stdcxx/trunk/examples/manual/limits.cpp (original)
+++ incubator/stdcxx/trunk/examples/manual/limits.cpp Thu Jan 11 14:07:07 2007
@@ -33,6 +33,20 @@
#include <examples.h>
+std::ostream& operator<< (std::ostream &strm, std::float_denorm_style style)
+{
+ const char* name = "(unknown)";
+
+ switch (style) {
+ case std::denorm_absent: name = "std::denorm_absent"; break;
+ case std::denorm_indeterminate: name = "std::denorm_indeterminate"; break;
+ case std::denorm_present: name = "std::denorm_present"; break;
+ }
+
+ return strm << name;
+}
+
+
template <class T>
void print_limits (std::ostream &strm, const char *tname, T)
{
@@ -66,7 +80,7 @@
PRINT_MEMBER ("const bool", has_infinity);
PRINT_MEMBER ("const bool", has_quiet_NaN);
PRINT_MEMBER ("const bool", has_signaling_NaN);
- PRINT_MEMBER ("const bool", has_denorm);
+ PRINT_MEMBER ("const std::float_denorm_style", has_denorm);
PRINT_MEMBER ("const bool", has_denorm_loss);
Modified: incubator/stdcxx/trunk/examples/manual/out/limits.out
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/examples/manual/out/limits.out?view=diff&rev=495402&r1=495401&r2=495402
==============================================================================
--- incubator/stdcxx/trunk/examples/manual/out/limits.out (original)
+++ incubator/stdcxx/trunk/examples/manual/out/limits.out Thu Jan 11 14:07:07
2007
@@ -17,7 +17,7 @@
static const bool has_infinity = false;
static const bool has_quiet_NaN = false;
static const bool has_signaling_NaN = false;
- static const bool has_denorm = 0;
+ static const std::float_denorm_style has_denorm = std::denorm_absent;
static const bool has_denorm_loss = false;
static int infinity () = 0;
static int quiet_NaN () = 0;
@@ -29,7 +29,7 @@
static const bool traps = true;
static const bool tinyness_before = false;
static const int round_style = 0;
-}
+};
struct std::numeric_limits<double> {
static const bool is_specialized = true;
@@ -50,7 +50,7 @@
static const bool has_infinity = true;
static const bool has_quiet_NaN = true;
static const bool has_signaling_NaN = true;
- static const bool has_denorm = 1;
+ static const std::float_denorm_style has_denorm = std::denorm_present;
static const bool has_denorm_loss = false;
static double infinity () = inf;
static double quiet_NaN () = nan;
@@ -62,4 +62,4 @@
static const bool traps = false;
static const bool tinyness_before = false;
static const int round_style = 1;
-}
+};