about summary refs log tree commit diff
path: root/arch
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-03-21 12:42:48 -0400
committerRich Felker <dalias@aerifal.cx>2012-03-21 12:42:48 -0400
commit47db8903f61e20aba53adfc987dfb576d22a0b81 (patch)
treeeaa4ecbe5df143a7080fb41088c144c61e9121df /arch
parent25501c1079756c9b438842da649585c2a6983c24 (diff)
downloadmusl-47db8903f61e20aba53adfc987dfb576d22a0b81.tar.gz
musl-47db8903f61e20aba53adfc987dfb576d22a0b81.tar.xz
musl-47db8903f61e20aba53adfc987dfb576d22a0b81.zip
fix DECIMAL_DIG definitions
DECIMAL_DIG is not the same as LDBL_DIG

type_DIG is the maximimum number of decimal digits that can survive a
round trip from decimal to type and back to decimal.

DECIMAL_DIG is the minimum number of decimal digits required in order
for any floating point type to survive the round trip to decimal and
back, and it is generally larger than LDBL_DIG. since the exact
formula is non-trivial, and defining it larger than necessary may be
legal but wasteful, just define the right value in bits/float.h.
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/bits/float.h2
-rw-r--r--arch/i386/bits/float.h2
-rw-r--r--arch/x86_64/bits/float.h2
3 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/bits/float.h b/arch/arm/bits/float.h
index 75fdc9bc..dce9e2d9 100644
--- a/arch/arm/bits/float.h
+++ b/arch/arm/bits/float.h
@@ -12,3 +12,5 @@
 #define LDBL_DIG 15
 #define LDBL_MIN_10_EXP (-307)
 #define LDBL_MAX_10_EXP 308
+
+#define DECIMAL_DIG 17
diff --git a/arch/i386/bits/float.h b/arch/i386/bits/float.h
index 044b516b..d439d40b 100644
--- a/arch/i386/bits/float.h
+++ b/arch/i386/bits/float.h
@@ -12,3 +12,5 @@
 #define LDBL_DIG 18
 #define LDBL_MIN_10_EXP (-4931)
 #define LDBL_MAX_10_EXP 4932
+
+#define DECIMAL_DIG 21
diff --git a/arch/x86_64/bits/float.h b/arch/x86_64/bits/float.h
index a58424e0..422a2df8 100644
--- a/arch/x86_64/bits/float.h
+++ b/arch/x86_64/bits/float.h
@@ -12,3 +12,5 @@
 #define LDBL_DIG 18
 #define LDBL_MIN_10_EXP (-4931)
 #define LDBL_MAX_10_EXP 4932
+
+#define DECIMAL_DIG 21