Source-Changes-HG archive

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

[src/trunk]: src/sys/sys C99: provide DECIMAL_DIG.



details:   https://anonhg.NetBSD.org/src/rev/01f9cc03c6f4
branches:  trunk
changeset: 553907:01f9cc03c6f4
user:      kleink <kleink%NetBSD.org@localhost>
date:      Wed Oct 22 20:31:05 2003 +0000

description:
C99: provide DECIMAL_DIG.

diffstat:

 sys/sys/float_ieee754.h |  18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diffs (30 lines):

diff -r bd77eb4858dc -r 01f9cc03c6f4 sys/sys/float_ieee754.h
--- a/sys/sys/float_ieee754.h   Wed Oct 22 20:26:32 2003 +0000
+++ b/sys/sys/float_ieee754.h   Wed Oct 22 20:31:05 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: float_ieee754.h,v 1.3 2003/10/22 16:18:48 kleink Exp $ */
+/*     $NetBSD: float_ieee754.h,v 1.4 2003/10/22 20:31:05 kleink Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -111,4 +111,20 @@
 #define        LDBL_MAX_10_EXP 4932
 #endif /* LDBL_MANT_DIG */
 
+#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
+    !defined(_XOPEN_SOURCE) || \
+    ((__STDC_VERSION__ - 0) >= 199901L) || \
+    ((_POSIX_C_SOURCE - 0) >= 200112L) || \
+    ((_XOPEN_SOURCE  - 0) >= 600) || \
+    defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
+#ifndef        DECIMAL_DIG
+#if LDBL_MANT_DIG == DBL_MANT_DIG
+#define        DECIMAL_DIG     17              /* ceil((1+p*log10(b))-(b==10) */
+#elif LDBL_MANT_DIG == 64
+#define        DECIMAL_DIG     21
+#elif LDBL_MANT_DIG == 113
+#define        DECIMAL_DIG     36
+#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */
+#endif /* DECIMAL_DIG */
+#endif /* !defined(_ANSI_SOURCE) && ... */
 #endif /* _SYS_FLOAT_IEEE754_H_ */



Home | Main Index | Thread Index | Old Index