This issue has been automatically converted from the original issue lists and some formatting may not have been preserved.
Authors: WG14, Jim Thomas
Date: 2017-10-25
Reference document: N2171
Submitted against: Floating-point TS 18661 (C11 version, 2014-2016)
Status: Fixed
Fixed in: C23
Converted from: n2397.htm
This DR addresses an issue related to DR 501 and IEC 60559 non-arithmetic interchange formats.
TS 18661-3 attempted to change the definition of DECIMAL_DIG
so that it would
apply to all supported IEC 60559 formats. DR 501 shows that this change is
problematic. After several unsuccessful attempts at a suitable TC, WG 14 and the
CFP group have agreed to obsolesce DECIMAL_DIG
in favor of the
type_DECIMAL_DIG
macros.
The type_DECIMAL_DIG
macros are helpful in using conversions between binary
floating-point formats and decimal character sequences. TS 18661-3 specifies
such conversions for non-arithmetic binary interchange formats, but neglects to
include the macros for such formats.
Likewise, the type_DIG
macros too are helpful in using conversions between
binary floating-point formats and decimal character sequences, though TS 18661-3
does not specify them for non-arithmetic formats.
The suggested TC below extends the set of FLT
N_DECIMAL_DIG
and
FLT
N_DIG
macros to include ones for IEC 60559 non-arithmetic binary
interchange formats.
In TS 18661-3 5.3, in the text for 5.2.4.2.2#6c, after the list for supported
types _Float
N
, insert:
for IEC 60559 non-arithmetic binary interchange formats of width N:
FLT
N_DECIMAL_DIG FLT
N_DIG
In TS 18661-3 clause 7, in the text for 5.2.4.2.2a#1, change:
The prefix
FLT
N_
indicates a binary interchange floating type of width N.
to:
The prefix
FLT
N_
indicates a binary interchange floating type or a non-arithmetic binary interchange format of width N.
Change the last sentence of 5.2.4.2.2a#1 from:
Conversely, for each such type that the implementation does not provide,
<float.h>
shall not define the associated macros in the following lists.
to:
Conversely, for each such type that the implementation does not provide,
<float.h>
shall not define the associated macros in the following list, except, the implementation shall define the macrosFLT
N_DECIMAL_DIG
andFLT
N_DIG
if it supports IEC 60559 non-arithmetic binary interchange formats of width N by providing the encoding-to-encoding conversion functions in<math.h>
and the string-to-encoding and string-from-encoding functions in<stdlib.h>
.
Comment from WG14 on 2018-10-18:
Oct 2017 meeting
The committee agreed with this issue and its proposed clarification.
Proposed Technical Clarification
In TS 18661-3 5.3, in the text for 5.2.4.2.2#6c, after the list for supported
types _Float
N
, insert:
for IEC 60559 non-arithmetic binary interchange formats of width N:
FLT
N_DECIMAL_DIG FLT
N_DIG
In TS 18661-3 clause 7, in the text for 5.2.4.2.2a#1, change:
The prefix
FLT
N_
indicates a binary interchange floating type of width N.
to:
The prefix
FLT
N_
indicates a binary interchange floating type or a non-arithmetic binary interchange format of width N.
Change the last sentence of 5.2.4.2.2a#1 from:
Conversely, for each such type that the implementation does not provide,
<float.h>
shall not define the associated macros in the following lists.
to:
Conversely, for each such type that the implementation does not provide,
<float.h>
shall not define the associated macros in the following list, except, the implementation shall define the macrosFLT
N_DECIMAL_DIG
andFLT
N_DIG
if it supports IEC 60559 non-arithmetic binary interchange formats of width N by providing the encoding-to-encoding conversion functions in<math.h>
and the string-to-encoding and string-from-encoding functions in<stdlib.h>
.