about summary refs log tree commit diff
path: root/bits
diff options
context:
space:
mode:
Diffstat (limited to 'bits')
-rw-r--r--bits/flt-eval-method.h42
-rw-r--r--bits/mathdef.h7
2 files changed, 42 insertions, 7 deletions
diff --git a/bits/flt-eval-method.h b/bits/flt-eval-method.h
new file mode 100644
index 0000000000..8ecd6a6664
--- /dev/null
+++ b/bits/flt-eval-method.h
@@ -0,0 +1,42 @@
+/* Define __GLIBC_FLT_EVAL_METHOD.
+   Copyright (C) 2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _MATH_H
+# error "Never use <bits/flt-eval-method.h> directly; include <math.h> instead."
+#endif
+
+/* __GLIBC_FLT_EVAL_METHOD is the value of FLT_EVAL_METHOD used to
+   determine the evaluation method typedefs such as float_t and
+   double_t.  It must be a value from C11 or TS 18661-3:2015, and not
+   -1.  */
+
+/* In the default version of this header, follow __FLT_EVAL_METHOD__.
+   -1 is mapped to 2 (considering evaluation as long double to be a
+   conservatively safe assumption), and if __FLT_EVAL_METHOD__ is not
+   defined then assume there is no excess precision and use the value
+   0.  */
+
+#ifdef __FLT_EVAL_METHOD__
+# if __FLT_EVAL_METHOD__ == -1
+#  define __GLIBC_FLT_EVAL_METHOD	2
+# else
+#  define __GLIBC_FLT_EVAL_METHOD	__FLT_EVAL_METHOD__
+# endif
+#else
+# define __GLIBC_FLT_EVAL_METHOD	0
+#endif
diff --git a/bits/mathdef.h b/bits/mathdef.h
index d557d08582..6dedc51c83 100644
--- a/bits/mathdef.h
+++ b/bits/mathdef.h
@@ -22,13 +22,6 @@
 #if defined  __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
 # define _MATH_H_MATHDEF	1
 
-/* Expressions are evaluated with the range and precision of their
-   type.  */
-typedef float float_t;		/* `float' expressions are evaluated as
-				   `float'.  */
-typedef double double_t;	/* `double' expressions are evaluated as
-				   `double'.  */
-
 /* The values returned by `ilogb' for 0 and NaN respectively.  */
 # define FP_ILOGB0	(-2147483647)
 # define FP_ILOGBNAN	2147483647