^(src/system\.h|tests/du/2g\.sh)$$
exclude_file_name_regexp--sc_prohibit_continued_string_alpha_in_column_1 = \
- ^src/(system\.h|od\.c|printf\.c)$$
+ ^src/(system\.h|od\.c|printf\.c|getlimits\.c)$$
exclude_file_name_regexp--sc_prohibit_test_backticks = \
^tests/(local\.mk|(init|misc/stdbuf|factor/create-test)\.sh)$$
#include <sys/types.h>
#include <float.h>
+#include "ftoastr.h"
#include "system.h"
#include "long-options.h"
return result;
}
+#define PRINT_FLOATTYPE(N, T, FTOASTR, BUFSIZE) \
+static void \
+N (T x) \
+{ \
+ char buf[BUFSIZE]; \
+ FTOASTR (buf, sizeof buf, FTOASTR_LEFT_JUSTIFY, 0, x); \
+ puts (buf); \
+}
+
+PRINT_FLOATTYPE (print_FLT, float, ftoastr, FLT_BUFSIZE_BOUND)
+PRINT_FLOATTYPE (print_DBL, double, dtoastr, DBL_BUFSIZE_BOUND)
+PRINT_FLOATTYPE (print_LDBL, long double, ldtoastr, LDBL_BUFSIZE_BOUND)
+
int
main (int argc, char **argv)
{
}
#define print_float(TYPE) \
- printf (#TYPE"_MIN=%Le\n", (long double)TYPE##_MIN); \
- printf (#TYPE"_MAX=%Le\n", (long double)TYPE##_MAX);
+ printf (#TYPE"_MIN="); print_##TYPE (TYPE##_MIN); \
+ printf (#TYPE"_MAX="); print_##TYPE (TYPE##_MAX);
/* Variable sized ints */
print_int (CHAR);