std_limits.h (__glibcpp_f32_round_error, [...]): Kill.
authorRichard Henderson <rth@redhat.com>
Sun, 22 Sep 2002 18:35:24 +0000 (11:35 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Sun, 22 Sep 2002 18:35:24 +0000 (11:35 -0700)
* include/std/std_limits.h (__glibcpp_f32_round_error,
__glibcpp_f64_round_error, __glibcpp_f80_round_error,
__glibcpp_f96_round_error, __glibcpp_f128_round_error,
__glibcpp_float_round_error, __glibcpp_double_round_error,
__glibcpp_long_double_round_error, __glibcpp_float_round_style,
__glibcpp_double_round_style, __glibcpp_long_double_round_style): Kill.
(numeric_limits<char>::epsilon, round_error): Use constant 0.
(numeric_limits<float>::round_error): Use constant 0.5.
(numeric_limits<float>::round_style): Use round_to_nearest.
(numeric_limits<double>, numeric_limits<long double>): Similarly.

From-SVN: r57412

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/std_limits.h

index 8ee38258a4ce6b87b6389af22408313d2064edb8..9d0be87bb7742f8247040146b5d78cf79a7516ef 100644 (file)
@@ -1,3 +1,16 @@
+2002-09-22  Richard Henderson  <rth@redhat.com>
+
+       * include/std/std_limits.h (__glibcpp_f32_round_error,
+       __glibcpp_f64_round_error, __glibcpp_f80_round_error,
+       __glibcpp_f96_round_error, __glibcpp_f128_round_error,
+       __glibcpp_float_round_error, __glibcpp_double_round_error,
+       __glibcpp_long_double_round_error, __glibcpp_float_round_style,
+       __glibcpp_double_round_style, __glibcpp_long_double_round_style): Kill.
+       (numeric_limits<char>::epsilon, round_error): Use constant 0.
+       (numeric_limits<float>::round_error): Use constant 0.5.
+       (numeric_limits<float>::round_style): Use round_to_nearest.
+       (numeric_limits<double>, numeric_limits<long double>): Similarly.
+
 2002-09-18  Loren J. Rittle  <ljrittle@acm.org>
 
        * testsuite/18_support/numeric_limits.cc (test_epsilon): New.
index a1d42244bf84789fcc407c28418e1ba41799e43b..088f506d9acaca9a36503fcd70607513eed8c298 100644 (file)
 #define __glibcpp_u64_digits 64
 #define __glibcpp_u64_digits10 19
 
-#define __glibcpp_f32_round_error 1.0F
 #if __GCC_FLOAT_FORMAT__ == __IEEE_FORMAT__
 #  define __glibcpp_f32_is_iec559  true
 #endif
 #ifndef __glibcpp_f32_is_iec559
 #  define __glibcpp_f32_is_iec559 false
 #endif 
-#define __glibcpp_f64_round_error 1.0
 #if __GCC_FLOAT_FORMAT__ == __IEEE_FORMAT__
 #  define __glibcpp_f64_is_iec559 true
 #endif
 #ifndef __glibcpp_f64_is_iec559
 #  define __glibcpp_f64_is_iec559 false
 #endif 
-#define __glibcpp_f80_round_error 1.0L
 #if __GCC_FLOAT_FORMAT__ == __IEEE_FORMAT__
 #  define __glibcpp_f80_is_iec559 true
 #endif
 #ifndef __glibcpp_f80_is_iec559
 #  define __glibcpp_f80_is_iec559 false
 #endif 
-#define __glibcpp_f96_round_error 1.0L
 #if __GCC_FLOAT_FORMAT__ == __IEEE_FORMAT__
 #  define __glibcpp_f96_is_iec559 true
 #endif
-#define __glibcpp_f128_round_error 1.0L
 #if __GCC_FLOAT_FORMAT__ == __IEEE_FORMAT__
 #  define __glibcpp_f128_is_iec559 true
 #endif
 //
 
 #if __FLOAT_BIT__ == 32
-#  define __glibcpp_float_round_error __glibcpp_f32_round_error
 #  define __glibcpp_float_is_iec559 __glibcpp_f32_is_iec559
 #elif __FLOAT_BIT__ == 64
-#  define __glibcpp_float_round_error __glibcpp_f64_round_error
 #  define __glibcpp_float_is_iec559 __glibcpp_f64_is_iec559
 #elif __FLOAT_BIT__ == 80
-#  define __glibcpp_float_round_error __glibcpp_f80_round_error
 #  define __glibcpp_float_is_iec559 __glibcpp_f80_is_iec559
 #else
 // You must define these macros in the configuration file.
 #  define __glibcpp_float_tinyness_before false
 #endif
 
-#ifndef __glibcpp_float_round_style
-#  define __glibcpp_float_round_style round_toward_zero
-#endif
-
 // double
 
 #if __DOUBLE_BIT__ == 32
-#  define __glibcpp_double_round_error __glibcpp_f32_round_error
 #  define __glibcpp_double_is_iec559 __glibcpp_f32_is_iec559
 #elif __DOUBLE_BIT__ == 64
-#  define __glibcpp_double_round_error __glibcpp_f64_round_error
 #  define __glibcpp_double_is_iec559 __glibcpp_f64_is_iec559
 #elif __DOUBLE_BIT__ == 80
-#  define __glibcpp_double_round_error __glibcpp_f80_round_error
 #  define __glibcpp_double_is_iec559 __glibcpp_f80_is_iec559
 #else
 // You must define these macros in the configuration file.
 #  define __glibcpp_double_tinyness_before false
 #endif
 
-#ifndef __glibcpp_double_round_style
-#  define __glibcpp_double_round_style round_toward_zero
-#endif
-
 // long double
 
 #if __LONG_DOUBLE_BIT__ == 32
-#  define __glibcpp_long_double_round_error __glibcpp_f32_round_error
 #  define __glibcpp_long_double_is_iec559 __glibcpp_f32_is_iec559
 #elif __LONG_DOUBLE_BIT__ == 64
-#  define __glibcpp_long_double_round_error __glibcpp_f64_round_error
 #  define __glibcpp_long_double_is_iec559 __glibcpp_f64_is_iec559
 #elif __LONG_DOUBLE_BIT__ == 80
-#  define __glibcpp_long_double_round_error __glibcpp_f80_round_error
 #  define __glibcpp_long_double_is_iec559 __glibcpp_f80_is_iec559
 #elif __LONG_DOUBLE_BIT__ == 96
-#  define __glibcpp_long_double_round_error __glibcpp_f96_round_error
 #  define __glibcpp_long_double_is_iec559 __glibcpp_f96_is_iec559
 #elif __LONG_DOUBLE_BIT__ == 128
-#  define __glibcpp_long_double_round_error __glibcpp_f128_round_error
 #  define __glibcpp_long_double_is_iec559 __glibcpp_f128_is_iec559
 #else
 // You must define these macros in the configuration file.
 #  define __glibcpp_long_double_tinyness_before false
 #endif
 
-#ifndef __glibcpp_long_double_round_style
-#  define __glibcpp_long_double_round_style round_toward_zero
-#endif
-
 
 namespace std
 {
@@ -825,9 +797,9 @@ namespace std
       static const bool is_exact = true;
       static const int radix = 2;
       static char epsilon() throw()
-      { return char(); }
+      { return 0; }
       static char round_error() throw()
-      { return char(); }
+      { return 0; }
 
       static const int min_exponent = 0;
       static const int min_exponent10 = 0;
@@ -1505,7 +1477,7 @@ namespace std
       static float epsilon() throw()
       { return __FLT_EPSILON__; }
       static float round_error() throw()
-      { return __glibcpp_float_round_error; }
+      { return 0.5F; }
 
       static const int min_exponent = __FLT_MIN_EXP__;
       static const int min_exponent10 = __FLT_MIN_10_EXP__;
@@ -1536,17 +1508,15 @@ namespace std
 
       static const bool traps = __glibcpp_float_traps;
       static const bool tinyness_before = __glibcpp_float_tinyness_before;
-      static const float_round_style round_style = __glibcpp_float_round_style;
+      static const float_round_style round_style = round_to_nearest;
     };
 
-#undef __glibcpp_float_round_error
 #undef __glibcpp_float_has_denorm_loss
 #undef __glibcpp_float_is_iec559
 #undef __glibcpp_float_is_bounded
 #undef __glibcpp_float_is_modulo
 #undef __glibcpp_float_traps
 #undef __glibcpp_float_tinyness_before
-#undef __glibcpp_float_round_style  
 
   template<>
     struct numeric_limits<double>
@@ -1567,7 +1537,7 @@ namespace std
       static double epsilon() throw()
       { return __DBL_EPSILON__; }
       static double round_error() throw()
-      { return __glibcpp_double_round_error; }
+      { return 0.5; }
 
       static const int min_exponent = __DBL_MIN_EXP__;
       static const int min_exponent10 = __DBL_MIN_10_EXP__;
@@ -1598,18 +1568,15 @@ namespace std
 
       static const bool traps = __glibcpp_double_traps;
       static const bool tinyness_before = __glibcpp_double_tinyness_before;
-      static const float_round_style round_style =
-              __glibcpp_double_round_style;
+      static const float_round_style round_style = round_to_nearest;
     };
 
-#undef __glibcpp_double_round_error
 #undef __glibcpp_double_has_denorm_loss
 #undef __glibcpp_double_is_iec559
 #undef __glibcpp_double_is_bounded
 #undef __glibcpp_double_is_modulo
 #undef __glibcpp_double_traps
 #undef __glibcpp_double_tinyness_before
-#undef __glibcpp_double_round_style  
   
   
   template<>
@@ -1631,7 +1598,7 @@ namespace std
       static long double epsilon() throw()
       { return __LDBL_EPSILON__; }
       static long double round_error() throw()
-      { return __glibcpp_long_double_round_error; }
+      { return 0.5L; }
 
       static const int min_exponent = __LDBL_MIN_EXP__;
       static const int min_exponent10 = __LDBL_MIN_10_EXP__;
@@ -1663,19 +1630,16 @@ namespace std
 
       static const bool traps = __glibcpp_long_double_traps; 
       static const bool tinyness_before = __glibcpp_long_double_tinyness_before;
-      static const float_round_style round_style = 
-        __glibcpp_long_double_round_style;
+      static const float_round_style round_style = round_to_nearest;
     };
 
-#undef __glibcpp_long_double_round_error
 #undef __glibcpp_long_double_has_denorm_loss
 #undef __glibcpp_long_double_is_iec559
 #undef __glibcpp_long_double_is_bounded
 #undef __glibcpp_long_double_is_modulo
 #undef __glibcpp_long_double_traps
 #undef __glibcpp_long_double_tinyness_before
-#undef __glibcpp_long_double_round_style  
-  
+
 } // namespace std
 
 #endif // _CPP_NUMERIC_LIMITS