summaryrefslogtreecommitdiff
path: root/src/float
diff options
context:
space:
mode:
Diffstat (limited to 'src/float')
-rw-r--r--src/float/DBL_DIG.c16
-rw-r--r--src/float/DBL_EPSILON.c16
-rw-r--r--src/float/DBL_MANT_DIG.c13
-rw-r--r--src/float/DBL_MAX.c15
-rw-r--r--src/float/DBL_MAX_10_EXP.c16
-rw-r--r--src/float/DBL_MAX_EXP.c12
-rw-r--r--src/float/DBL_MIN.c15
-rw-r--r--src/float/DBL_MIN_10_EXP.c16
-rw-r--r--src/float/DBL_MIN_EXP.c12
-rw-r--r--src/float/DECIMAL_DIG.c10
-rw-r--r--src/float/FLT_DIG.c16
-rw-r--r--src/float/FLT_EPSILON.c16
-rw-r--r--src/float/FLT_EVAL_METHOD.c13
-rw-r--r--src/float/FLT_MANT_DIG.c13
-rw-r--r--src/float/FLT_MAX.c15
-rw-r--r--src/float/FLT_MAX_10_EXP.c15
-rw-r--r--src/float/FLT_MAX_EXP.c12
-rw-r--r--src/float/FLT_MIN.c15
-rw-r--r--src/float/FLT_MIN_10_EXP.c16
-rw-r--r--src/float/FLT_MIN_EXP.c12
-rw-r--r--src/float/FLT_RADIX.c16
-rw-r--r--src/float/FLT_ROUNDS.c22
-rw-r--r--src/float/LDBL_DIG.c16
-rw-r--r--src/float/LDBL_EPSILON.c16
-rw-r--r--src/float/LDBL_MANT_DIG.c13
-rw-r--r--src/float/LDBL_MAX.c15
-rw-r--r--src/float/LDBL_MAX_10_EXP.c16
-rw-r--r--src/float/LDBL_MAX_EXP.c12
-rw-r--r--src/float/LDBL_MIN.c15
-rw-r--r--src/float/LDBL_MIN_10_EXP.c16
-rw-r--r--src/float/LDBL_MIN_EXP.c12
31 files changed, 453 insertions, 0 deletions
diff --git a/src/float/DBL_DIG.c b/src/float/DBL_DIG.c
new file mode 100644
index 00000000..9f656012
--- /dev/null
+++ b/src/float/DBL_DIG.c
@@ -0,0 +1,16 @@
+#include <float.h>
+#define DBL_DIG (15)
+
+/** double significant digits **/
+
+/***
+is the number of significant digits in a decimal representation of a
+TYPE(double) that are guaranteed accuracy.
+***/
+
+/*
+VALUE_MIN(10)
+*/
+/*
+STDC(1)
+*/
diff --git a/src/float/DBL_EPSILON.c b/src/float/DBL_EPSILON.c
new file mode 100644
index 00000000..5e4bd6b8
--- /dev/null
+++ b/src/float/DBL_EPSILON.c
@@ -0,0 +1,16 @@
+#include <float.h>
+#define DBL_EPSILON (2.220446E-16)
+
+/** double epsilon **/
+
+/***
+is the difference between LITERAL(1) and the next smallest number
+representable as a TYPE(double).
+***/
+
+/*
+VALUE_MIN(1e-9)
+*/
+/*
+STDC(1)
+*/
diff --git a/src/float/DBL_MANT_DIG.c b/src/float/DBL_MANT_DIG.c
new file mode 100644
index 00000000..b89e6ac1
--- /dev/null
+++ b/src/float/DBL_MANT_DIG.c
@@ -0,0 +1,13 @@
+#include <float.h>
+#define DBL_MANT_DIG (53)
+
+/** double mantissa **/
+
+/***
+is the number of digits, in base-IDENTIFIER(FLT_RADIX), in the
+floating-point significand for TYPE(double) variables. It is not necessarily
+a constant value.
+***/
+/*
+STDC(1)
+*/
diff --git a/src/float/DBL_MAX.c b/src/float/DBL_MAX.c
new file mode 100644
index 00000000..91d1e704
--- /dev/null
+++ b/src/float/DBL_MAX.c
@@ -0,0 +1,15 @@
+#include <float.h>
+#define DBL_MAX (1.797693E+308)
+
+/** double maximum value **/
+
+/***
+is the maximum representable finite TYPE(double) value.
+***/
+
+/*
+VALUE_MIN(1e+37)
+*/
+/*
+STDC(1)
+*/
diff --git a/src/float/DBL_MAX_10_EXP.c b/src/float/DBL_MAX_10_EXP.c
new file mode 100644
index 00000000..8238d34b
--- /dev/null
+++ b/src/float/DBL_MAX_10_EXP.c
@@ -0,0 +1,16 @@
+#include <float.h>
+#define DBL_MAX_10_EXP (308)
+
+/** double maximum base-10 exponent **/
+
+/***
+is the largest integer for which POW(10,THIS()) is a finite
+TYPE(double).
+***/
+
+/*
+VALUE_MIN(37)
+*/
+/*
+STDC(1)
+*/
diff --git a/src/float/DBL_MAX_EXP.c b/src/float/DBL_MAX_EXP.c
new file mode 100644
index 00000000..38fdb2a8
--- /dev/null
+++ b/src/float/DBL_MAX_EXP.c
@@ -0,0 +1,12 @@
+#include <float.h>
+#define DBL_MAX_EXP (1024)
+
+/** double maximum exponent **/
+
+/***
+is the largest integer for which
+POW(IDENTIFIER(FLT_RADIX),THIS() - 1) is a finite TYPE(double).
+***/
+/*
+STDC(1)
+*/
diff --git a/src/float/DBL_MIN.c b/src/float/DBL_MIN.c
new file mode 100644
index 00000000..7f3c9ce1
--- /dev/null
+++ b/src/float/DBL_MIN.c
@@ -0,0 +1,15 @@
+#include <float.h>
+#define DBL_MIN (2.225074E-308)
+
+/** double minimum positive number **/
+
+/***
+is the smallest normalized value of a TYPE(double).
+***/
+
+/*
+VALUE_MIN(1e-37)
+*/
+/*
+STDC(1)
+*/
diff --git a/src/float/DBL_MIN_10_EXP.c b/src/float/DBL_MIN_10_EXP.c
new file mode 100644
index 00000000..f329b0a1
--- /dev/null
+++ b/src/float/DBL_MIN_10_EXP.c
@@ -0,0 +1,16 @@
+#include <float.h>
+#define DBL_MIN_10_EXP (-307)
+
+/** double minimum base-10 exponent **/
+
+/***
+is the smallest negative integer for which POW(10, THIS())
+is a normalized TYPE(double).
+***/
+
+/*
+VALUE_MIN(-37)
+*/
+/*
+STDC(1)
+*/
diff --git a/src/float/DBL_MIN_EXP.c b/src/float/DBL_MIN_EXP.c
new file mode 100644
index 00000000..cc5dd645
--- /dev/null
+++ b/src/float/DBL_MIN_EXP.c
@@ -0,0 +1,12 @@
+#include <float.h>
+#define DBL_MIN_EXP (-1021)
+
+/** double minimum exponent **/
+
+/***
+is the smallest negative integer for which
+POW(IDENTIFIER(FLT_RADIX), THIS() - 1) is a normalized TYPE(double).
+***/
+/*
+STDC(1)
+*/
diff --git a/src/float/DECIMAL_DIG.c b/src/float/DECIMAL_DIG.c
new file mode 100644
index 00000000..6003cb49
--- /dev/null
+++ b/src/float/DECIMAL_DIG.c
@@ -0,0 +1,10 @@
+#include <float.h>
+
+#define DECIMAL_DIG (10)
+
+/* MIN: 10 */
+
+/*
+STDC(199901)
+LINK(m)
+*/
diff --git a/src/float/FLT_DIG.c b/src/float/FLT_DIG.c
new file mode 100644
index 00000000..43a17c3f
--- /dev/null
+++ b/src/float/FLT_DIG.c
@@ -0,0 +1,16 @@
+#include <float.h>
+#define FLT_DIG (6)
+
+/** float significant digits **/
+
+/***
+is the number of significant digits in a decimal representation of a
+TYPE(float) that are guaranteed accuracy.
+***/
+
+/*
+VALUE_MIN(6)
+*/
+/*
+STDC(1)
+*/
diff --git a/src/float/FLT_EPSILON.c b/src/float/FLT_EPSILON.c
new file mode 100644
index 00000000..31640457
--- /dev/null
+++ b/src/float/FLT_EPSILON.c
@@ -0,0 +1,16 @@
+#include <float.h>
+#define FLT_EPSILON (1.192093E-07)
+
+/** float epsilon **/
+
+/***
+is the difference between LITERAL(1) and the next smallest number
+representable as a TYPE(float).
+***/
+
+/*
+VALUE_MIN(1e-5)
+*/
+/*
+STDC(1)
+*/
diff --git a/src/float/FLT_EVAL_METHOD.c b/src/float/FLT_EVAL_METHOD.c
new file mode 100644
index 00000000..46fa8194
--- /dev/null
+++ b/src/float/FLT_EVAL_METHOD.c
@@ -0,0 +1,13 @@
+#include <float.h>
+
+#define FLT_EVAL_METHOD (-1)
+
+/* -1: indeterminable */
+/* 0: float as float; double as double; long double as long double */
+/* 1: float as double; double as double; long double as long double */
+/* 2: all as long double */
+
+/*
+STDC(199901)
+LINK(m)
+*/
diff --git a/src/float/FLT_MANT_DIG.c b/src/float/FLT_MANT_DIG.c
new file mode 100644
index 00000000..608ff5f9
--- /dev/null
+++ b/src/float/FLT_MANT_DIG.c
@@ -0,0 +1,13 @@
+#include <float.h>
+#define FLT_MANT_DIG (24)
+
+/** float mantissa **/
+
+/***
+is the number of digits, in base-IDENTIFIER(FLT_RADIX), in the
+floating-point significand for TYPE(float) variables. It is not necessarily
+a constant value.
+***/
+/*
+STDC(1)
+*/
diff --git a/src/float/FLT_MAX.c b/src/float/FLT_MAX.c
new file mode 100644
index 00000000..ecd59b0d
--- /dev/null
+++ b/src/float/FLT_MAX.c
@@ -0,0 +1,15 @@
+#include <float.h>
+#define FLT_MAX (3.402823E+38)
+
+/** float maximum value **/
+
+/***
+is the maximum representable finite TYPE(float) value.
+***/
+
+/*
+VALUE_MIN(1e+37)
+*/
+/*
+STDC(1)
+*/
diff --git a/src/float/FLT_MAX_10_EXP.c b/src/float/FLT_MAX_10_EXP.c
new file mode 100644
index 00000000..2b64a7e7
--- /dev/null
+++ b/src/float/FLT_MAX_10_EXP.c
@@ -0,0 +1,15 @@
+#include <float.h>
+#define FLT_MAX_10_EXP (38)
+
+/** float maximum base-10 exponent **/
+
+/***
+is the largest integer for which POW(10, THIS()) is a finite TYPE(float).
+***/
+
+/*
+VALUE_MIN(37)
+*/
+/*
+STDC(1)
+*/
diff --git a/src/float/FLT_MAX_EXP.c b/src/float/FLT_MAX_EXP.c
new file mode 100644
index 00000000..d912e1ec
--- /dev/null
+++ b/src/float/FLT_MAX_EXP.c
@@ -0,0 +1,12 @@
+#include <float.h>
+#define FLT_MAX_EXP (128)
+
+/** float maximum exponent **/
+
+/***
+is the largest integer for which
+POW(IDENTIFIER(FLT_RADIX), THIS() - 1) is a finite TYPE(float).
+***/
+/*
+STDC(1)
+*/
diff --git a/src/float/FLT_MIN.c b/src/float/FLT_MIN.c
new file mode 100644
index 00000000..aac248c5
--- /dev/null
+++ b/src/float/FLT_MIN.c
@@ -0,0 +1,15 @@
+#include <float.h>
+#define FLT_MIN (1.175494E-38)
+
+/** float minimum positive number **/
+
+/***
+is the smallest normalized value of a TYPE(float).
+***/
+
+/*
+VALUE_MIN(1e-37)
+*/
+/*
+STDC(1)
+*/
diff --git a/src/float/FLT_MIN_10_EXP.c b/src/float/FLT_MIN_10_EXP.c
new file mode 100644
index 00000000..57f9eb95
--- /dev/null
+++ b/src/float/FLT_MIN_10_EXP.c
@@ -0,0 +1,16 @@
+#include <float.h>
+#define FLT_MIN_10_EXP (-37)
+
+/** float minimum base-10 exponent **/
+
+/***
+is the smallest negative integer for which POW(10, THIS())
+is a normalized TYPE(float).
+***/
+
+/*
+VALUE_MIN(-37)
+*/
+/*
+STDC(1)
+*/
diff --git a/src/float/FLT_MIN_EXP.c b/src/float/FLT_MIN_EXP.c
new file mode 100644
index 00000000..682c8d4f
--- /dev/null
+++ b/src/float/FLT_MIN_EXP.c
@@ -0,0 +1,12 @@
+#include <float.h>
+#define FLT_MIN_EXP (-125)
+
+/** float minimum exponent **/
+
+/***
+is the smallest negative integer for which
+POW(IDENTIFIER(FLT_RADIX), THIS() - 1) is a normalized TYPE(float).
+***/
+/*
+STDC(1)
+*/
diff --git a/src/float/FLT_RADIX.c b/src/float/FLT_RADIX.c
new file mode 100644
index 00000000..47978707
--- /dev/null
+++ b/src/float/FLT_RADIX.c
@@ -0,0 +1,16 @@
+#include <float.h>
+#define FLT_RADIX (2)
+
+/** radix of exponent representation **/
+
+/***
+is a constant defining the radix used by the implementation for
+exponent notation. It is suitable for use in LITERAL(#if) directives.
+***/
+
+/*
+VALUE_MIN(2)
+*/
+/*
+STDC(1)
+*/
diff --git a/src/float/FLT_ROUNDS.c b/src/float/FLT_ROUNDS.c
new file mode 100644
index 00000000..8fefb48e
--- /dev/null
+++ b/src/float/FLT_ROUNDS.c
@@ -0,0 +1,22 @@
+#include <float.h>
+ extern int fegetround(void);
+#define FLT_ROUNDS fegetround()
+
+/** rounding direction **/
+
+/***
+describes the rounding mode of floating-point addition used by the
+implementation. It is not necessarily constant.
+***/
+
+/*
+VALUE_SELECT(-1, indeterminable)
+VALUE_SELECT(0, toward zero)
+VALUE_SELECT(1, to nearest)
+VALUE_SELECT(2, toward positive infinity)
+VALUE_SELECT(3, toward negative infinity)
+SEE_ALSO(FUNCTION(fegetround))
+*/
+/*
+STDC(1)
+*/
diff --git a/src/float/LDBL_DIG.c b/src/float/LDBL_DIG.c
new file mode 100644
index 00000000..f986ecc2
--- /dev/null
+++ b/src/float/LDBL_DIG.c
@@ -0,0 +1,16 @@
+#include <float.h>
+#define LDBL_DIG (15)
+
+/** long double significant digits **/
+
+/***
+is the number of significant digits in a decimal representation of a
+TYPE(long double) that are guaranteed accuracy.
+***/
+
+/*
+VALUE_MIN(10)
+*/
+/*
+STDC(1)
+*/
diff --git a/src/float/LDBL_EPSILON.c b/src/float/LDBL_EPSILON.c
new file mode 100644
index 00000000..ebc089a4
--- /dev/null
+++ b/src/float/LDBL_EPSILON.c
@@ -0,0 +1,16 @@
+#include <float.h>
+#define LDBL_EPSILON (2.220446E-16)
+
+/** long double epsilon **/
+
+/***
+is the difference between LITERAL(1) and the next smallest number
+representable as a TYPE(long double).
+***/
+
+/*
+VALUE_MIN(1e-9)
+*/
+/*
+STDC(1)
+*/
diff --git a/src/float/LDBL_MANT_DIG.c b/src/float/LDBL_MANT_DIG.c
new file mode 100644
index 00000000..19c85a9e
--- /dev/null
+++ b/src/float/LDBL_MANT_DIG.c
@@ -0,0 +1,13 @@
+#include <float.h>
+#define LDBL_MANT_DIG (53)
+
+/** long double mantissa **/
+
+/***
+is the number of digits, in base-IDENTIFIER(FLT_RADIX), in the
+floating-point significand for TYPE(long double) variables. It is not
+necessarily a constant value.
+***/
+/*
+STDC(1)
+*/
diff --git a/src/float/LDBL_MAX.c b/src/float/LDBL_MAX.c
new file mode 100644
index 00000000..4ca1301a
--- /dev/null
+++ b/src/float/LDBL_MAX.c
@@ -0,0 +1,15 @@
+#include <float.h>
+#define LDBL_MAX (1.797693E+308)
+
+/** long double maximum value **/
+
+/***
+is the maximum representable finite TYPE(long double) value.
+***/
+
+/*
+VALUE_MIN(1e+37)
+*/
+/*
+STDC(1)
+*/
diff --git a/src/float/LDBL_MAX_10_EXP.c b/src/float/LDBL_MAX_10_EXP.c
new file mode 100644
index 00000000..6ff02738
--- /dev/null
+++ b/src/float/LDBL_MAX_10_EXP.c
@@ -0,0 +1,16 @@
+#include <float.h>
+#define LDBL_MAX_10_EXP (308)
+
+/** long double maximum base-10 exponent **/
+
+/***
+is the largest integer for which POW(10, THIS()) is a finite
+TYPE(long double).
+***/
+
+/*
+VALUE_MIN(37)
+*/
+/*
+STDC(1)
+*/
diff --git a/src/float/LDBL_MAX_EXP.c b/src/float/LDBL_MAX_EXP.c
new file mode 100644
index 00000000..e52d91e5
--- /dev/null
+++ b/src/float/LDBL_MAX_EXP.c
@@ -0,0 +1,12 @@
+#include <float.h>
+#define LDBL_MAX_EXP (1024)
+
+/** long double maximum exponent **/
+
+/***
+is the largest integer for which
+POW(IDENTIFIER(FLT_RADIX), THIS() - 1) is a finite TYPE(long double).
+***/
+/*
+STDC(1)
+*/
diff --git a/src/float/LDBL_MIN.c b/src/float/LDBL_MIN.c
new file mode 100644
index 00000000..0416fe71
--- /dev/null
+++ b/src/float/LDBL_MIN.c
@@ -0,0 +1,15 @@
+#include <float.h>
+#define LDBL_MIN (2.225074E-308)
+
+/** long double minimum positive number **/
+
+/***
+is the smallest normalized value of a TYPE(long double).
+***/
+
+/*
+VALUE_MIN(1e-37)
+*/
+/*
+STDC(1)
+*/
diff --git a/src/float/LDBL_MIN_10_EXP.c b/src/float/LDBL_MIN_10_EXP.c
new file mode 100644
index 00000000..6876716d
--- /dev/null
+++ b/src/float/LDBL_MIN_10_EXP.c
@@ -0,0 +1,16 @@
+#include <float.h>
+#define LDBL_MIN_10_EXP (-37)
+
+/** long double minimum base-10 exponent **/
+
+/***
+is the smallest negative integer for which POW(10, THIS())
+is a normalized TYPE(long double).
+***/
+
+/*
+VALUE_MIN(-37)
+*/
+/*
+STDC(1)
+*/
diff --git a/src/float/LDBL_MIN_EXP.c b/src/float/LDBL_MIN_EXP.c
new file mode 100644
index 00000000..ea65763e
--- /dev/null
+++ b/src/float/LDBL_MIN_EXP.c
@@ -0,0 +1,12 @@
+#include <float.h>
+#define LDBL_MIN_EXP (-1021)
+
+/** long double minimum exponent **/
+
+/***
+is the smallest negative integer for which
+POW(IDENTIFIER(FLT_RADIX), THIS() - 1) is a normalized TYPE(long double).
+***/
+/*
+STDC(1)
+*/