**Document:** WG14 N1377

**Submitter:** Fred Tydeman (USA)

**Submission Date:** 2009-03-31

**Previous version of paper:** N1303, N1317, N1352

**Related WG14 documents:** N1151, N1171

**Subject:** **xxx_DECIMAL_DIG** macros for
<float.h>

Existing practice: C99 has **DECIMAL_DIG** with the
similar meaning as **LDBL_DECIMAL_DIG**.

This is a rewrite based upon feedback from the committee.

**Changes to C1x**

Add new bullets to **5.2.4.2.2 Characteristics of floating
types <float.h>**

[bullet near DECIMAL_DIG] number of decimal digits, *n*,
such that any floating-point number with *p* radix
*b* digits can be rounded to a floating-point number
with *n* decimal digits and back again without change to
the value,

plog10bifbis power of 10 ceil(1 +plog10b) otherwise

[Note to editor: WG14 C1x WP for **DECIMAL_DIG** has
correct symbols/fonts for the above two math expressions.]

FLT_DECIMAL_DIG 6DBL_DECIMAL_DIG 10LDBL_DECIMAL_DIG 10

[paragraph 14, example 1] Add

afterFLT_DECIMAL_DIG 9

[paragraph 15, example 2] Add

beforeFLT_DECIMAL_DIG 9DBL_DECIMAL_DIG 17

**Words for Rationale:**

[add to 5.2.4.2.2 section] For applications that need to print non-decimal FP values as decimal values, and read them later, can use xxx_DECIMAL_DIG macros as the precision to make sure that the original value is kept.