DragonFly submit List (threaded) for 2008-04
DragonFly BSD
DragonFly submit List (threaded) for 2008-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: float_t and double_t (C99)


From: Hasso Tepper <hasso@xxxxxxxxx>
Date: Mon, 7 Apr 2008 23:13:53 +0300

OK, second attempt attached. Obtained-from: FreeBSD with minor 
modifications.

-- 
Hasso Tepper
diff --git a/sys/cpu/amd64/include/float.h b/sys/cpu/amd64/include/float.h
--- a/sys/cpu/amd64/include/float.h
+++ b/sys/cpu/amd64/include/float.h
@@ -40,8 +40,10 @@
 
 #define FLT_RADIX	2		/* b */
 #define FLT_ROUNDS	1		/* FP addition rounds to nearest */
-#define	FLT_EVAL_METHOD	(-1)		/* i387 semantics are...interesting */
+#if __ISO_C_VISIBLE >= 1999
+#define	FLT_EVAL_METHOD	0		/* no promotions */
 #define	DECIMAL_DIG	21		/* max precision in decimal digits */
+#endif
 
 #define FLT_MANT_DIG	24		/* p */
 #define FLT_EPSILON	1.19209290E-07F	/* b**(1-p) */
diff --git a/sys/cpu/amd64/include/math.h b/sys/cpu/amd64/include/math.h
--- a/sys/cpu/amd64/include/math.h
+++ b/sys/cpu/amd64/include/math.h
@@ -9,4 +9,10 @@
 #define	__HAVE_LONG_DOUBLE
 #define	__HAVE_NANF
 
+#if __ISO_C_VISIBLE >= 1999
+/* 7.12#2 float_t, double_t */
+typedef float	float_t;
+typedef double	double_t;
 #endif
+
+#endif
diff --git a/sys/cpu/i386/include/float.h b/sys/cpu/i386/include/float.h
--- a/sys/cpu/i386/include/float.h
+++ b/sys/cpu/i386/include/float.h
@@ -40,6 +40,10 @@
 
 #define FLT_RADIX	2		/* b */
 #define FLT_ROUNDS	1		/* FP addition rounds to nearest */
+#if __ISO_C_VISIBLE >= 1999
+#define FLT_EVAL_METHOD	(-1)		/* i387 semantics are...interesting */
+#define DECIMAL_DIG	21		/* max precision in decimal digits */
+#endif
 
 #define FLT_MANT_DIG	24		/* p */
 #define FLT_EPSILON	1.19209290E-07F	/* b**(1-p) */
diff --git a/sys/cpu/i386/include/math.h b/sys/cpu/i386/include/math.h
--- a/sys/cpu/i386/include/math.h
+++ b/sys/cpu/i386/include/math.h
@@ -9,4 +9,10 @@
 #define	__HAVE_LONG_DOUBLE
 #define	__HAVE_NANF
 
+#if __ISO_C_VISIBLE >= 1999
+/* 7.12#2 float_t, double_t */
+typedef long double	float_t;
+typedef long double	double_t;
 #endif
+
+#endif


[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]