[Cfp-interest] (SC22WG14.14285) Can DECIMAL_DIG be larger than necessary?

Joseph Myers joseph at codesourcery.com
Tue Jun 21 14:31:50 PDT 2016


On Tue, 21 Jun 2016, Jim Thomas wrote:

> What is the harm in allowing DECIMAL_DIG to be wider than the give 
> formula? Using the macro to determine the number of digits to print 
> might result in more digits than would be necessary or desirable (for 
> standard floating types). Even without Part 3, the macro couldn’t be 
> used in reproducible programs because it depends on long double.

I don't see harm, but unless you make the macro depend on 
__STDC_WANT_IEC_60559_TYPES_EXT__, there's arguably a defect in C11 that 
would need addressing there to make it clear that the value may be larger.

-- 
Joseph S. Myers
joseph at codesourcery.com


More information about the Cfp-interest mailing list