From 47db8903f61e20aba53adfc987dfb576d22a0b81 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 21 Mar 2012 12:42:48 -0400 Subject: 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. --- arch/x86_64/bits/float.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/x86_64') 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 -- cgit v1.2.1