[Cfp-interest 2486] Re: 5.2.4.2.3 and IEC 60559
Fred J. Tydeman
tydeman at tybor.com
Wed Aug 3 09:08:55 PDT 2022
On Tue, 2 Aug 2022 09:56:10 +0200 Vincent Lefevre wrote:
>
>On 2022-08-01 22:46:01 -0500, Fred J. Tydeman wrote:
>> It appears to me that section 5.2.4.2.3 assumes that decimal floating point (DFP) is IEC 60559 DFP..
>> Yet, I do not see such a requirement in 5.2.4.2.3.
>>
>> I do see in 6.2.5#12 that the formats are IEC 60559 DFP.
>
>I think that should also be put in 5.2.4.2.3.
>
>BTW, does the standard clearly say that these types are optional?
>This just seems to be suggested by 5.2.4.2.3, but 6.2.5#12 says
>no more than "There are three decimal floating types, designated
>as _Decimal32, _Decimal64, and _Decimal128. Respectively, they
>have the IEC 60559 formats: decimal32, decimal64, and decimal128.
>Decimal floating types are real floating types.", which could be
>interpreted as such types being mandatory. Compare with _Complex,
>for which it is said "Complex types are a conditional feature that
>implementations need not support;".
>
>Moreover, it seems that if one of these 3 types is supported, then
>the 3 of them need to be supported. Is this wanted?
Page 183, 6.10.9.3 Conditional feature macros
__STDC_IEC_60559_DFP__ The integer constant 202311L, intended to indicate support of decimal
floating types and conformance to Annex F (IEC 60559 floating-point arithmetic) for
decimal floating-point arithmetic.
Page 474, B.6.1 Characteristics of decimal floating types
The following macros are provided only if the implementation defines __STDC_IEC_60559_DFP__ .
N is 32, 64 and 128.
DEC_INFINITY
DECN_MANT_DIG
DECN _MIN_EXP
DECN _SNAN
DEC_NAN
DECN_MAX_EXP
DECN _MIN
DECN_EPSILON
DECN_MAX
DECN _TRUE_MIN
Page 547, #4 (H.2.1): "An implementation that defines __STDC_IEC_60559_DFP__
provides the decimal floating types _Decimal32 , _Decimal64 , and
_Decimal128 (6.2.5)."
Given the above, it seems to me that the first sentence in:
5.2.4.2.3 Characteristics of decimal floating types in <float.h>:
This subclause specifies macros in <float.h> that provide characteristics of decimal floating types
in terms of the model presented in 5.2.4.2.2.
should be changed to:
This subclause specifies macros in <float.h> that provide characteristics of IEC 60559 decimal floating types
(an optional feature) in terms of the model presented in 5.2.4.2.2.
---
Fred J. Tydeman Tydeman Consulting
tydeman at tybor.com Testing, numerics, programming
+1 (702) 608-6093 Vice-chair of PL22.11 (ANSI "C")
Sample C99+FPCE tests: http://www.tybor.com
Savers sleep well, investors eat well, spenders work forever.
More information about the Cfp-interest
mailing list