]> pd.if.org Git - pdclib/commitdiff
<float.h> is now implemented in the platform independent portion. It is based
authorOwen Shepherd <owen.shepherd@e43.eu>
Thu, 16 Aug 2012 23:13:35 +0000 (00:13 +0100)
committerOwen Shepherd <owen.shepherd@e43.eu>
Thu, 16 Aug 2012 23:13:35 +0000 (00:13 +0100)
upon a macro family defined in _PDCLIB_float.h, which is similar in structore
to the existing _PDCLIB_int.h. It is controlled by three definitions in
_PDCLIB_config.h, which define which IEEE 754 format the floating point types
are in. This removes a GCC dependency from all of the targets, and should help
in making PDCLib support other compilers

includes/float.h [moved from platform/example/includes/float.h with 61% similarity]
internals/_PDCLIB_aux.h
internals/_PDCLIB_float.h [new file with mode: 0644]
platform/posix/includes/float.h [deleted file]
platform/win32/includes/float.h [deleted file]
platform/win32/internals/_PDCLIB_config.h

similarity index 61%
rename from platform/example/includes/float.h
rename to includes/float.h
index 659053997fc9b7b62a590db93c96a2bcfbea4cb8..e72a31e494773d13613c5e72e7b14eedf975ee19 100644 (file)
@@ -1,76 +1,76 @@
-/* $Id$ */
-
-/* 7.7 Characteristics of floating types <float.h>
-
-   This file is part of the Public Domain C Library (PDCLib).
-   Permission is granted to use, modify, and / or redistribute at will.
-*/
-
-#ifndef _PDCLIB_FLOAT_H
-#define _PDCLIB_FLOAT_H _PDCLIB_FLOAT_H
-#include <_PDCLIB_config.h>
-
-#define FLT_ROUNDS      _PDCLIB_FLT_ROUNDS
-#define FLT_EVAL_METHOD _PDCLIB_FLT_EVAL_METHOD
-#define DECIMAL_DIG     _PDCLIB_DECIMAL_DIG
-
-   /* Radix of exponent representation */
-#define FLT_RADIX      __FLT_RADIX__
-   /* Number of base-FLT_RADIX digits in the significand of a float */
-#define FLT_MANT_DIG   __FLT_MANT_DIG__
-   /* Number of decimal digits of precision in a float */
-#define FLT_DIG        __FLT_DIG__
-   /* Difference between 1.0 and the minimum float greater than 1.0 */
-#define FLT_EPSILON    __FLT_EPSILON__
-   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */
-#define FLT_MIN_EXP    __FLT_MIN_EXP__
-   /* Minimum normalised float */
-#define FLT_MIN        __FLT_MIN__
-   /* Minimum int x such that 10**x is a normalised float */
-#define FLT_MIN_10_EXP __FLT_MIN_10_EXP__
-   /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */
-#define FLT_MAX_EXP    __FLT_MAX_EXP__
-   /* Maximum float */
-#define FLT_MAX        __FLT_MAX__
-   /* Maximum int x such that 10**x is a representable float */
-#define FLT_MAX_10_EXP __FLT_MAX_10_EXP__
-
-   /* Number of base-FLT_RADIX digits in the significand of a double */
-#define DBL_MANT_DIG   __DBL_MANT_DIG__
-   /* Number of decimal digits of precision in a double */
-#define DBL_DIG        __DBL_DIG__
-   /* Difference between 1.0 and the minimum double greater than 1.0 */
-#define DBL_EPSILON    __DBL_EPSILON__
-   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */
-#define DBL_MIN_EXP    __DBL_MIN_EXP__
-   /* Minimum normalised double */
-#define DBL_MIN        __DBL_MIN__
-   /* Minimum int x such that 10**x is a normalised double */
-#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__
-   /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */
-#define DBL_MAX_EXP    __DBL_MAX_EXP__
-   /* Maximum double */
-#define DBL_MAX        __DBL_MAX__
-   /* Maximum int x such that 10**x is a representable double */
-#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
-
-   /* Number of base-FLT_RADIX digits in the significand of a long double */
-#define LDBL_MANT_DIG   __LDBL_MANT_DIG__
-   /* Number of decimal digits of precision in a long double */
-#define LDBL_DIG        __LDBL_DIG__
-   /* Difference between 1.0 and the minimum long double greater than 1.0 */
-#define LDBL_EPSILON    __LDBL_EPSILON__
-   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */
-#define LDBL_MIN_EXP    __LDBL_MIN_EXP__
-   /* Minimum normalised long double */
-#define LDBL_MIN        __LDBL_MIN__
-   /* Minimum int x such that 10**x is a normalised long double */
-#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__
-   /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */
-#define LDBL_MAX_EXP    __LDBL_MAX_EXP__
-   /* Maximum long double */
-#define LDBL_MAX        __LDBL_MAX__
-   /* Maximum int x such that 10**x is a representable long double */
-#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__
-
-#endif
+/* $Id$ */\r
+\r
+/* 7.7 Characteristics of floating types <float.h>\r
+\r
+   This file is part of the Public Domain C Library (PDCLib).\r
+   Permission is granted to use, modify, and / or redistribute at will.\r
+*/\r
+\r
+#ifndef _PDCLIB_FLOAT_H\r
+#define _PDCLIB_FLOAT_H _PDCLIB_FLOAT_H\r
+#include <_PDCLIB_float.h>\r
+\r
+#define FLT_ROUNDS      _PDCLIB_FLT_ROUNDS\r
+#define FLT_EVAL_METHOD _PDCLIB_FLT_EVAL_METHOD\r
+#define DECIMAL_DIG     _PDCLIB_DECIMAL_DIG\r
+\r
+   /* Radix of exponent representation */\r
+#define FLT_RADIX       _PDCLIB_FLT_RADIX\r
+   /* Number of base-FLT_RADIX digits in the significand of a float */\r
+#define FLT_MANT_DIG    _PDCLIB_FLT_MANT_DIG\r
+   /* Number of decimal digits of precision in a float */\r
+#define FLT_DIG         _PDCLIB_FLT_DIG\r
+   /* Difference between 1.0 and the minimum float greater than 1.0 */\r
+#define FLT_EPSILON     _PDCLIB_FLT_EPSILON\r
+   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */\r
+#define FLT_MIN_EXP     _PDCLIB_FLT_MIN_EXP\r
+   /* Minimum normalised float */\r
+#define FLT_MIN         _PDCLIB_FLT_MIN\r
+   /* Minimum int x such that 10**x is a normalised float */\r
+#define FLT_MIN_10_EXP  _PDCLIB_FLT_MIN_10_EXP\r
+   /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */\r
+#define FLT_MAX_EXP     _PDCLIB_FLT_MAX_EXP\r
+   /* Maximum float */\r
+#define FLT_MAX         _PDCLIB_FLT_MAX\r
+   /* Maximum int x such that 10**x is a representable float */\r
+#define FLT_MAX_10_EXP  _PDCLIB_FLT_MAX_10_EXP\r
+\r
+   /* Number of base-FLT_RADIX digits in the significand of a double */\r
+#define DBL_MANT_DIG    _PDCLIB_DBL_MANT_DIG\r
+   /* Number of decimal digits of precision in a double */\r
+#define DBL_DIG         _PDCLIB_DBL_DIG\r
+   /* Difference between 1.0 and the minimum double greater than 1.0 */\r
+#define DBL_EPSILON     _PDCLIB_DBL_EPSILON\r
+   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */\r
+#define DBL_MIN_EXP     _PDCLIB_DBL_MIN_EXP\r
+   /* Minimum normalised double */\r
+#define DBL_MIN         _PDCLIB_DBL_MIN\r
+   /* Minimum int x such that 10**x is a normalised double */\r
+#define DBL_MIN_10_EXP  _PDCLIB_DBL_MIN_10_EXP\r
+   /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */\r
+#define DBL_MAX_EXP     _PDCLIB_DBL_MAX_EXP\r
+   /* Maximum double */\r
+#define DBL_MAX         _PDCLIB_DBL_MAX\r
+   /* Maximum int x such that 10**x is a representable double */\r
+#define DBL_MAX_10_EXP  _PDCLIB_DBL_MAX_10_EXP\r
+\r
+   /* Number of base-FLT_RADIX digits in the significand of a long double */\r
+#define LDBL_MANT_DIG   _PDCLIB_LDBL_MANT_DIG\r
+   /* Number of decimal digits of precision in a long double */\r
+#define LDBL_DIG        _PDCLIB_LDBL_DIG\r
+   /* Difference between 1.0 and the minimum long double greater than 1.0 */\r
+#define LDBL_EPSILON    _PDCLIB_LDBL_EPSILON\r
+   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */\r
+#define LDBL_MIN_EXP    _PDCLIB_LDBL_MIN_EXP\r
+   /* Minimum normalised long double */\r
+#define LDBL_MIN        _PDCLIB_LDBL_MIN\r
+   /* Minimum int x such that 10**x is a normalised long double */\r
+#define LDBL_MIN_10_EXP _PDCLIB_LDBL_MIN_10_EXP\r
+   /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */\r
+#define LDBL_MAX_EXP    _PDCLIB_LDBL_MAX_EXP\r
+   /* Maximum long double */\r
+#define LDBL_MAX        _PDCLIB_LDBL_MAX\r
+   /* Maximum int x such that 10**x is a representable long double */\r
+#define LDBL_MAX_10_EXP _PDCLIB_LDBL_MAX_10_EXP\r
+\r
+#endif\r
index 5183c9fdc3c08d6ef7759097178391d555b96dac..3de8d4a9deeac2361fd981b4d1fcfc9406d6beb4 100644 (file)
 
 #define _PDCLIB_cc( x, y )     x ## y
 #define _PDCLIB_concat( x, y ) _PDCLIB_cc( x, y )
+#define _PDCLIB_concat3( x, y, z ) _PDCLIB_concat( _PDCLIB_concat( x, y ), z )
 
 #define _PDCLIB_symbol2value( x ) #x
 #define _PDCLIB_symbol2string( x ) _PDCLIB_symbol2value( x )
diff --git a/internals/_PDCLIB_float.h b/internals/_PDCLIB_float.h
new file mode 100644 (file)
index 0000000..62051e0
--- /dev/null
@@ -0,0 +1,93 @@
+#ifndef _PDCLIB_PDCLIB_FLOAT_H\r
+#define _PDCLIB_PDCLIB_FLOAT_H _PDCLIB_PDCLIB_FLOAT_H\r
+\r
+/* PDCLib internal floating point logic <_PDCLIB_float.h>\r
+\r
+   This file is part of the Public Domain C Library (PDCLib).\r
+   Permission is granted to use, modify, and / or redistribute at will.\r
+*/\r
+\r
+/* IEEE 754 single precision */\r
+#define _PDCLIB_FP_SINGLE_MIN 1.17549435082228750797e-38\r
+#define _PDCLIB_FP_SINGLE_EPSILON 1.19209289550781250000e-7\r
+#define _PDCLIB_FP_SINGLE_HAS_DENORM 1\r
+#define _PDCLIB_FP_SINGLE_MIN_EXP -125\r
+#define _PDCLIB_FP_SINGLE_MANT_DIG 24\r
+#define _PDCLIB_FP_SINGLE_RADIX 2\r
+#define _PDCLIB_FP_SINGLE_HAS_QUIET_NAN 1\r
+#define _PDCLIB_FP_SINGLE_MAX_10_EXP 38\r
+#define _PDCLIB_FP_SINGLE_HAS_INFINITY 1\r
+#define _PDCLIB_FP_SINGLE_DIG 6\r
+#define _PDCLIB_FP_SINGLE_MAX_EXP 128\r
+#define _PDCLIB_FP_SINGLE_DENORM_MIN 1.40129846432481707092e-45\r
+#define _PDCLIB_FP_SINGLE_MAX 3.40282346638528859812e+38\r
+#define _PDCLIB_FP_SINGLE_MIN_10_EXP -37\r
+\r
+/* IEEE 754 double precision */\r
+#define _PDCLIB_FP_DOUBLE_MIN_EXP -1021\r
+#define _PDCLIB_FP_DOUBLE_DENORM_MIN 4.94065645841246544177e-324\r
+#define _PDCLIB_FP_DOUBLE_MIN_10_EXP -307\r
+#define _PDCLIB_FP_DOUBLE_DIG 15\r
+#define _PDCLIB_FP_DOUBLE_MAX 1.79769313486231570815e+308\r
+#define _PDCLIB_FP_DOUBLE_HAS_INFINITY 1\r
+#define _PDCLIB_FP_DOUBLE_MAX_EXP 1024\r
+#define _PDCLIB_FP_DOUBLE_MIN 2.22507385850720138309e-308\r
+#define _PDCLIB_FP_DOUBLE_HAS_DENORM 1\r
+#define _PDCLIB_FP_DOUBLE_HAS_QUIET_NAN 1\r
+#define _PDCLIB_FP_DOUBLE_MANT_DIG 53\r
+#define _PDCLIB_FP_DOUBLE_EPSILON 2.22044604925031308085e-16\r
+#define _PDCLIB_FP_DOUBLE_MAX_10_EXP 308\r
+\r
+/* IEEE 754 80-bit extended precision */\r
+#define _PDCLIB_FP_EXTENDED_MAX 1.18973149535723176502e+4932\r
+#define _PDCLIB_FP_EXTENDED_MAX_EXP 16384\r
+#define _PDCLIB_FP_EXTENDED_HAS_INFINITY 1\r
+#define _PDCLIB_FP_EXTENDED_MIN 3.36210314311209350626e-4932\r
+#define _PDCLIB_FP_EXTENDED_HAS_QUIET_NAN 1\r
+#define _PDCLIB_FP_EXTENDED_HAS_DENORM 1\r
+#define _PDCLIB_FP_EXTENDED_EPSILON 1.08420217248550443401e-19\r
+#define _PDCLIB_FP_EXTENDED_MANT_DIG 64\r
+#define _PDCLIB_FP_EXTENDED_MIN_EXP (-16381)\r
+#define _PDCLIB_FP_EXTENDED_MAX_10_EXP 4932\r
+#define _PDCLIB_FP_EXTENDED_DENORM_MIN 3.64519953188247460253e-4951\r
+#define _PDCLIB_FP_EXTENDED_MIN_10_EXP (-4931)\r
+#define _PDCLIB_FP_EXTENDED_DIG 18\r
+\r
+/* TODO: IEEE754 quadruple precision (_PDCLIB_FP_QUADRUPLE_*) and\r
+         "double-double" math\r
+ */\r
+\r
+#define _PDCLIB_FLT_RADIX       ((float) _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_FLOAT_TYPE, _RADIX ))\r
+#define _PDCLIB_FLT_MANT_DIG    _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_FLOAT_TYPE, _MANT_DIG )\r
+#define _PDCLIB_FLT_DIG         _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_FLOAT_TYPE, _DIG )\r
+#define _PDCLIB_FLT_EPSILON     ((float) _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_FLOAT_TYPE, _EPSILON ))\r
+#define _PDCLIB_FLT_MIN_EXP     _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_FLOAT_TYPE, _MIN_EXP )\r
+#define _PDCLIB_FLT_MIN         ((float) _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_FLOAT_TYPE, _MIN ))\r
+#define _PDCLIB_FLT_MIN_10_EXP  _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_FLOAT_TYPE, _MIN_10_EXP )\r
+#define _PDCLIB_FLT_MAX_EXP     _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_FLOAT_TYPE, _MAX_EXP )\r
+#define _PDCLIB_FLT_MAX         ((float) _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_FLOAT_TYPE, _MAX ))\r
+#define _PDCLIB_FLT_MAX_10_EXP  _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_FLOAT_TYPE, _MAX_10_EXP )\r
+\r
+#define _PDCLIB_DBL_RADIX       ((double) _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_DOUBLE_TYPE, _RADIX ))\r
+#define _PDCLIB_DBL_MANT_DIG    _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_DOUBLE_TYPE, _MANT_DIG )\r
+#define _PDCLIB_DBL_DIG         _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_DOUBLE_TYPE, _DIG )\r
+#define _PDCLIB_DBL_EPSILON     ((double) _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_DOUBLE_TYPE, _EPSILON ))\r
+#define _PDCLIB_DBL_MIN_EXP     _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_DOUBLE_TYPE, _MIN_EXP )\r
+#define _PDCLIB_DBL_MIN         ((double) _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_DOUBLE_TYPE, _MIN ))\r
+#define _PDCLIB_DBL_MIN_10_EXP  _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_DOUBLE_TYPE, _MIN_10_EXP )\r
+#define _PDCLIB_DBL_MAX_EXP     _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_DOUBLE_TYPE, _MAX_EXP )\r
+#define _PDCLIB_DBL_MAX         ((double) _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_DOUBLE_TYPE, _MAX ))\r
+#define _PDCLIB_DBL_MAX_10_EXP  _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_DOUBLE_TYPE, _MAX_10_EXP )\r
+\r
+#define _PDCLIB_LDBL_RADIX       ((long double) _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_LDOUBLE_TYPE, _RADIX ))\r
+#define _PDCLIB_LDBL_MANT_DIG    _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_LDOUBLE_TYPE, _MANT_DIG )\r
+#define _PDCLIB_LDBL_DIG         _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_LDOUBLE_TYPE, _DIG )\r
+#define _PDCLIB_LDBL_EPSILON     ((long double) _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_LDOUBLE_TYPE, _EPSILON ))\r
+#define _PDCLIB_LDBL_MIN_EXP     _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_LDOUBLE_TYPE, _MIN_EXP )\r
+#define _PDCLIB_LDBL_MIN         ((long double) _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_LDOUBLE_TYPE, _MIN ))\r
+#define _PDCLIB_LDBL_MIN_10_EXP  _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_LDOUBLE_TYPE, _MIN_10_EXP )\r
+#define _PDCLIB_LDBL_MAX_EXP     _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_LDOUBLE_TYPE, _MAX_EXP )\r
+#define _PDCLIB_LDBL_MAX         ((long double) _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_LDOUBLE_TYPE, _MAX ))\r
+#define _PDCLIB_LDBL_MAX_10_EXP  _PDCLIB_concat3( _PDCLIB_FP_, _PDCLIB_LDOUBLE_TYPE, _MAX_10_EXP )\r
+\r
+#endif
\ No newline at end of file
diff --git a/platform/posix/includes/float.h b/platform/posix/includes/float.h
deleted file mode 100644 (file)
index 6590539..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* $Id$ */
-
-/* 7.7 Characteristics of floating types <float.h>
-
-   This file is part of the Public Domain C Library (PDCLib).
-   Permission is granted to use, modify, and / or redistribute at will.
-*/
-
-#ifndef _PDCLIB_FLOAT_H
-#define _PDCLIB_FLOAT_H _PDCLIB_FLOAT_H
-#include <_PDCLIB_config.h>
-
-#define FLT_ROUNDS      _PDCLIB_FLT_ROUNDS
-#define FLT_EVAL_METHOD _PDCLIB_FLT_EVAL_METHOD
-#define DECIMAL_DIG     _PDCLIB_DECIMAL_DIG
-
-   /* Radix of exponent representation */
-#define FLT_RADIX      __FLT_RADIX__
-   /* Number of base-FLT_RADIX digits in the significand of a float */
-#define FLT_MANT_DIG   __FLT_MANT_DIG__
-   /* Number of decimal digits of precision in a float */
-#define FLT_DIG        __FLT_DIG__
-   /* Difference between 1.0 and the minimum float greater than 1.0 */
-#define FLT_EPSILON    __FLT_EPSILON__
-   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */
-#define FLT_MIN_EXP    __FLT_MIN_EXP__
-   /* Minimum normalised float */
-#define FLT_MIN        __FLT_MIN__
-   /* Minimum int x such that 10**x is a normalised float */
-#define FLT_MIN_10_EXP __FLT_MIN_10_EXP__
-   /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */
-#define FLT_MAX_EXP    __FLT_MAX_EXP__
-   /* Maximum float */
-#define FLT_MAX        __FLT_MAX__
-   /* Maximum int x such that 10**x is a representable float */
-#define FLT_MAX_10_EXP __FLT_MAX_10_EXP__
-
-   /* Number of base-FLT_RADIX digits in the significand of a double */
-#define DBL_MANT_DIG   __DBL_MANT_DIG__
-   /* Number of decimal digits of precision in a double */
-#define DBL_DIG        __DBL_DIG__
-   /* Difference between 1.0 and the minimum double greater than 1.0 */
-#define DBL_EPSILON    __DBL_EPSILON__
-   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */
-#define DBL_MIN_EXP    __DBL_MIN_EXP__
-   /* Minimum normalised double */
-#define DBL_MIN        __DBL_MIN__
-   /* Minimum int x such that 10**x is a normalised double */
-#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__
-   /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */
-#define DBL_MAX_EXP    __DBL_MAX_EXP__
-   /* Maximum double */
-#define DBL_MAX        __DBL_MAX__
-   /* Maximum int x such that 10**x is a representable double */
-#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
-
-   /* Number of base-FLT_RADIX digits in the significand of a long double */
-#define LDBL_MANT_DIG   __LDBL_MANT_DIG__
-   /* Number of decimal digits of precision in a long double */
-#define LDBL_DIG        __LDBL_DIG__
-   /* Difference between 1.0 and the minimum long double greater than 1.0 */
-#define LDBL_EPSILON    __LDBL_EPSILON__
-   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */
-#define LDBL_MIN_EXP    __LDBL_MIN_EXP__
-   /* Minimum normalised long double */
-#define LDBL_MIN        __LDBL_MIN__
-   /* Minimum int x such that 10**x is a normalised long double */
-#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__
-   /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */
-#define LDBL_MAX_EXP    __LDBL_MAX_EXP__
-   /* Maximum long double */
-#define LDBL_MAX        __LDBL_MAX__
-   /* Maximum int x such that 10**x is a representable long double */
-#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__
-
-#endif
diff --git a/platform/win32/includes/float.h b/platform/win32/includes/float.h
deleted file mode 100644 (file)
index 6590539..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* $Id$ */
-
-/* 7.7 Characteristics of floating types <float.h>
-
-   This file is part of the Public Domain C Library (PDCLib).
-   Permission is granted to use, modify, and / or redistribute at will.
-*/
-
-#ifndef _PDCLIB_FLOAT_H
-#define _PDCLIB_FLOAT_H _PDCLIB_FLOAT_H
-#include <_PDCLIB_config.h>
-
-#define FLT_ROUNDS      _PDCLIB_FLT_ROUNDS
-#define FLT_EVAL_METHOD _PDCLIB_FLT_EVAL_METHOD
-#define DECIMAL_DIG     _PDCLIB_DECIMAL_DIG
-
-   /* Radix of exponent representation */
-#define FLT_RADIX      __FLT_RADIX__
-   /* Number of base-FLT_RADIX digits in the significand of a float */
-#define FLT_MANT_DIG   __FLT_MANT_DIG__
-   /* Number of decimal digits of precision in a float */
-#define FLT_DIG        __FLT_DIG__
-   /* Difference between 1.0 and the minimum float greater than 1.0 */
-#define FLT_EPSILON    __FLT_EPSILON__
-   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */
-#define FLT_MIN_EXP    __FLT_MIN_EXP__
-   /* Minimum normalised float */
-#define FLT_MIN        __FLT_MIN__
-   /* Minimum int x such that 10**x is a normalised float */
-#define FLT_MIN_10_EXP __FLT_MIN_10_EXP__
-   /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */
-#define FLT_MAX_EXP    __FLT_MAX_EXP__
-   /* Maximum float */
-#define FLT_MAX        __FLT_MAX__
-   /* Maximum int x such that 10**x is a representable float */
-#define FLT_MAX_10_EXP __FLT_MAX_10_EXP__
-
-   /* Number of base-FLT_RADIX digits in the significand of a double */
-#define DBL_MANT_DIG   __DBL_MANT_DIG__
-   /* Number of decimal digits of precision in a double */
-#define DBL_DIG        __DBL_DIG__
-   /* Difference between 1.0 and the minimum double greater than 1.0 */
-#define DBL_EPSILON    __DBL_EPSILON__
-   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */
-#define DBL_MIN_EXP    __DBL_MIN_EXP__
-   /* Minimum normalised double */
-#define DBL_MIN        __DBL_MIN__
-   /* Minimum int x such that 10**x is a normalised double */
-#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__
-   /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */
-#define DBL_MAX_EXP    __DBL_MAX_EXP__
-   /* Maximum double */
-#define DBL_MAX        __DBL_MAX__
-   /* Maximum int x such that 10**x is a representable double */
-#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
-
-   /* Number of base-FLT_RADIX digits in the significand of a long double */
-#define LDBL_MANT_DIG   __LDBL_MANT_DIG__
-   /* Number of decimal digits of precision in a long double */
-#define LDBL_DIG        __LDBL_DIG__
-   /* Difference between 1.0 and the minimum long double greater than 1.0 */
-#define LDBL_EPSILON    __LDBL_EPSILON__
-   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */
-#define LDBL_MIN_EXP    __LDBL_MIN_EXP__
-   /* Minimum normalised long double */
-#define LDBL_MIN        __LDBL_MIN__
-   /* Minimum int x such that 10**x is a normalised long double */
-#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__
-   /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */
-#define LDBL_MAX_EXP    __LDBL_MAX_EXP__
-   /* Maximum long double */
-#define LDBL_MAX        __LDBL_MAX__
-   /* Maximum int x such that 10**x is a representable long double */
-#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__
-
-#endif
index 17c8ff4a74a1e7ff1d9f4c1ad21c924bcaa3f109..81e13a67ff8c1d4f996b7e5593bb351951c206f8 100644 (file)
@@ -246,6 +246,18 @@ struct _PDCLIB_imaxdiv_t
 */
 #define _PDCLIB_DECIMAL_DIG 17
 
+/* Floating point types
+ *
+ * PDCLib (at present) assumes IEEE 754 floating point formats
+ * The following names are used:
+ *    SINGLE:   IEEE 754 single precision (32-bit)
+ *    DOUBLE:   IEEE 754 double precision (64-bit)
+ *    EXTENDED: IEEE 754 extended precision (80-bit, as x87)
+ */
+#define _PDCLIB_FLOAT_TYPE   SINGLE
+#define _PDCLIB_DOUBLE_TYPE  DOUBLE
+#define _PDCLIB_LDOUBLE_TYPE EXTENDED
+
 /* -------------------------------------------------------------------------- */
 /* Platform-dependent macros defined by the standard headers.                 */
 /* -------------------------------------------------------------------------- */