OSDN Git Service

* ginclude/float.h: Check that __STDC_WANT_DEC_FP__ is defined,
[pf3gnuchains/gcc-fork.git] / gcc / ginclude / float.h
index 3cdf7c8..23ce8f4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2007 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
 
 This file is part of GCC.
 
@@ -159,4 +159,83 @@ Boston, MA 02110-1301, USA.  */
 #define DECIMAL_DIG    __DECIMAL_DIG__
 
 #endif /* C99 */
 #define DECIMAL_DIG    __DECIMAL_DIG__
 
 #endif /* C99 */
+
+#ifdef __STDC_WANT_DEC_FP__
+/* Draft Technical Report 24732, extension for decimal floating-point
+   arithmetic: Characteristic of decimal floating types <float.h>.  */
+
+/* Number of base-FLT_RADIX digits in the significand, p.  */
+#undef DEC32_MANT_DIG
+#undef DEC64_MANT_DIG
+#undef DEC128_MANT_DIG
+#define DEC32_MANT_DIG __DEC32_MANT_DIG__
+#define DEC64_MANT_DIG __DEC64_MANT_DIG__
+#define DEC128_MANT_DIG        __DEC128_MANT_DIG__
+
+/* Minimum exponent. */
+#undef DEC32_MIN_EXP
+#undef DEC64_MIN_EXP
+#undef DEC128_MIN_EXP
+#define DEC32_MIN_EXP  __DEC32_MIN_EXP__
+#define DEC64_MIN_EXP  __DEC64_MIN_EXP__
+#define DEC128_MIN_EXP __DEC128_MIN_EXP__
+
+/* Maximum exponent. */
+#undef DEC32_MAX_EXP
+#undef DEC64_MAX_EXP
+#undef DEC128_MAX_EXP
+#define DEC32_MAX_EXP  __DEC32_MAX_EXP__
+#define DEC64_MAX_EXP  __DEC64_MAX_EXP__
+#define DEC128_MAX_EXP __DEC128_MAX_EXP__
+
+/* Maximum representable finite decimal floating-point number
+   (there are 6, 15, and 33 9s after the decimal points respectively). */
+#undef DEC32_MAX
+#undef DEC64_MAX
+#undef DEC128_MAX
+#define DEC32_MAX   __DEC32_MAX__
+#define DEC64_MAX   __DEC64_MAX__
+#define DEC128_MAX  __DEC128_MAX__
+
+/* The difference between 1 and the least value greater than 1 that is
+   representable in the given floating point type. */
+#undef DEC32_EPSILON
+#undef DEC64_EPSILON
+#undef DEC128_EPSILON
+#define DEC32_EPSILON  __DEC32_EPSILON__
+#define DEC64_EPSILON  __DEC64_EPSILON__
+#define DEC128_EPSILON __DEC128_EPSILON__
+
+/* Minimum normalized positive floating-point number. */
+#undef DEC32_MIN
+#undef DEC64_MIN
+#undef DEC128_MIN
+#define DEC32_MIN      __DEC32_MIN__
+#define DEC64_MIN      __DEC64_MIN__
+#define DEC128_MIN     __DEC128_MIN__
+
+/* Minimum denormalized positive floating-point number. */
+#undef DEC32_DEN
+#undef DEC64_DEN
+#undef DEC128_DEN
+#define DEC32_DEN       __DEC32_DEN__
+#define DEC64_DEN       __DEC64_DEN__
+#define DEC128_DEN      __DEC128_DEN__
+
+/* The floating-point expression evaluation method.
+         -1  indeterminate
+         0  evaluate all operations and constants just to the range and
+            precision of the type
+         1  evaluate operations and constants of type _Decimal32 
+           and _Decimal64 to the range and precision of the _Decimal64 
+            type, evaluate _Decimal128 operations and constants to the 
+           range and precision of the _Decimal128 type;
+        2  evaluate all operations and constants to the range and
+           precision of the _Decimal128 type.  */
+
+#undef DECFLT_EVAL_METHOD
+#define DECFLT_EVAL_METHOD     __DECFLT_EVAL_METHOD__
+
+#endif /* __STDC_WANT_DEC_FP__ */
+
 #endif /* _FLOAT_H___ */
 #endif /* _FLOAT_H___ */