LIA-1, denormals and is_iec559 and C++

Richard Henderson rth@redhat.com
Wed Sep 25 10:19:00 GMT 2002


On Wed, Sep 25, 2002 at 06:49:04PM +0200, Gabriel Dos Reis wrote:
> Below is the answer I got from the SC22/WG11 committee about the
> possibility of having has_denormal == denormal_absent and 
> is_iec559 == true:  That isn't right.

Then the following would be appropriate.


r~


	* include/std/std_limits.h (numeric_limits<T>::is_iec559): False
	if denormals are not supported.

Index: std_limits.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/std/std_limits.h,v
retrieving revision 1.16
diff -c -p -d -u -r1.16 std_limits.h
--- std_limits.h	23 Sep 2002 11:24:56 -0000	1.16
+++ std_limits.h	25 Sep 2002 17:16:35 -0000
@@ -912,7 +912,8 @@ namespace std
       static float denorm_min() throw()
       { return __FLT_DENORM_MIN__; }
 
-      static const bool is_iec559 = has_infinity && has_quiet_NaN;
+      static const bool is_iec559
+	= has_infinity && has_quiet_NaN && has_denorm == denorm_present;
       static const bool is_bounded = true;
       static const bool is_modulo = false;
 
@@ -969,7 +970,8 @@ namespace std
       static double denorm_min() throw()
       { return __DBL_DENORM_MIN__; }
 
-      static const bool is_iec559 = has_infinity && has_quiet_NaN;
+      static const bool is_iec559
+	= has_infinity && has_quiet_NaN && has_denorm == denorm_present;
       static const bool is_bounded = true;
       static const bool is_modulo = false;
 
@@ -1027,7 +1029,8 @@ namespace std
       static long double denorm_min() throw()
       { return __LDBL_DENORM_MIN__; }
 
-      static const bool is_iec559 = has_infinity && has_quiet_NaN;
+      static const bool is_iec559
+	= has_infinity && has_quiet_NaN && has_denorm == denorm_present;
       static const bool is_bounded = true;
       static const bool is_modulo = false;
 



More information about the Libstdc++ mailing list