summaryrefslogtreecommitdiff
path: root/lib/libc/stdio/floatio.h
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2005-05-14 23:51:02 +0000
committerchristos <christos@NetBSD.org>2005-05-14 23:51:02 +0000
commitf432bbb6fd73bc9d4d16cf9c092973e4e42be033 (patch)
tree56cbac36b68d8cb044f5972fa52a2acea82b3a69 /lib/libc/stdio/floatio.h
parentf023cb8f18705041e5180cb1052cdd3f01e81b9b (diff)
Add the missing wide char support functions from freebsd.
XXX: long double support is missing until we get gdtoa, and add the necessary wide functions.
Diffstat (limited to 'lib/libc/stdio/floatio.h')
-rw-r--r--lib/libc/stdio/floatio.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/libc/stdio/floatio.h b/lib/libc/stdio/floatio.h
index ecef6340c97..6c04cc2e2c6 100644
--- a/lib/libc/stdio/floatio.h
+++ b/lib/libc/stdio/floatio.h
@@ -1,4 +1,4 @@
-/* $NetBSD: floatio.h,v 1.4 2003/08/07 16:43:24 agc Exp $ */
+/* $NetBSD: floatio.h,v 1.5 2005/05/14 23:51:02 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -42,3 +42,14 @@
#define MAXEXP 308
/* 128 bit fraction takes up 39 decimal digits; max reasonable precision */
#define MAXFRACT 39
+/*
+ * MAXEXPDIG is the maximum number of decimal digits needed to store a
+ * floating point exponent in the largest supported format. It should
+ * be ceil(log10(LDBL_MAX_10_EXP)) or, if hexadecimal floating point
+ * conversions are supported, ceil(log10(LDBL_MAX_EXP)). But since it
+ * is presently never greater than 5 in practice, we fudge it.
+ */
+#define MAXEXPDIG 6
+#if LDBL_MAX_EXP > 999999
+#error "floating point buffers too small"
+#endif