<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><blockquote type="cite"><h1 style="font-family: Times; font-variant-ligatures: normal; orphans: 2; widows: 2; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><span style="font-size: 12px;"><b style="font-variant-ligatures: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Fred J. Tydeman</b><span style="font-variant-ligatures: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"> </span><a href="mailto:cfp-interest%40oakapple.net?Subject=Re%3A%20%5BCfp-interest%202818%5D%20Re%3A%20CFP%20review%20of%20TS-4%20revisions&In-Reply-To=%3C100.2817020017a1da64.005%40tybor.com%3E" title="[Cfp-interest 2818] Re: CFP review of TS-4 revisions" style="font-variant-ligatures: normal;">tydeman at tybor.com</a></span></h1><i style="font-family: Times; font-variant-ligatures: normal; orphans: 2; widows: 2; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Mon Aug 14 13:48:07 PDT 2023</i><span style="font-family: Times; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"></span><p style="font-family: Times; font-variant-ligatures: normal; orphans: 2; widows: 2; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"></p><ul style="font-family: Times; font-variant-ligatures: normal; orphans: 2; widows: 2; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><li></li></ul><pre style="white-space: pre-wrap; font-variant-ligatures: normal; orphans: 2; widows: 2; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">On Sun, 6 Aug 2023 08:58:54 -0700 Jim Thomas wrote:
><i>
</i>><i><a href="https://wiki.edg.com/pub/CFP/WebHome/cfp4r-20230806.pdf">https://wiki.edg.com/pub/CFP/WebHome/cfp4r-20230806.pdf</a>
</i>><i>
</i>
Fred's comments on TS 18661-4
5.1 page 2, line 6: Is there a problem with freestanding
implementations and <math.h> and trying to access the FP exception
flags? [C23 4.0 Conformance, paragraph 7]
</pre></blockquote><div style="orphans: 2; widows: 2;">Is this a question about the TS or C? According to <span style="orphans: 2; white-space: pre-wrap; widows: 2;">C23 4 #7 a strictly conforming program </span><span style="white-space: pre-wrap;">that defines __STDC_IEC_60559_BFP__ or __STDC_IEC_60559_DFP__ can’t access exception flags because it can’t set the FENV_ACCESS</span> state to “on”.</div><blockquote type="cite"><pre style="white-space: pre-wrap; font-variant-ligatures: normal; orphans: 2; widows: 2; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">
6.0 page 3, line 8: Why "may" for SNaN?
</pre></blockquote>Annex F doesn’t require support for signaling NaNs. The TSes don’t add a stricter requirement here.<br><blockquote type="cite"><pre style="white-space: pre-wrap; font-variant-ligatures: normal; orphans: 2; widows: 2; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">
6.1 page 3, line 17: Can one get the extended functions without having
to get the extended types? Should there be functions for _Decimal32,
_Decimal64, _Decimal128 without having to get extended types?
</pre></blockquote>I assume you mean “extension” instead of “extended”. Yes, the intention is that <div><br></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>#define __STDC_WANT_IEC_60559_TYPES_EXT__</div></blockquote><div><br></div><div>is needed only for the functions for extension types in Annex H. To fully express the feature and want macro dependencies in the synopses gets messy. E.g. d32, d64, and d128 functions may be declared without TYPES but other dN or dNx functions require TYPES. Here’s a suggestion:</div><div><br></div><div>Just before 6.1 insert the paragraph:</div><div><br></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>For each of the following synopses, an implementation shall declare the functions suffixed with fN or fNx for each supported corresponding binary floating type and shall declare the functions suffixed with dN or dNx for each supported corresponding decimal floating type. (See C23 Annex H.)</div></blockquote><div><br></div><div>and delete</div><div><br></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>#define __STDC_WANT_IEC_60559_TYPES_EXT__</div></blockquote><div><br></div><div>from each synopsis.</div><div><br></div><div>Just before 7.1 insert the paragraph:</div><div><br></div><div><blockquote style="margin: 0px 0px 0px 40px; border: medium; padding: 0px;">For each of the following synopses, an implementation shall declare the functions suffixed with fN or fNx for each supported corresponding binary floating type. (See C23 Annex H.)</blockquote></div><div><div><br></div><div>and delete</div><div><br></div><blockquote style="margin: 0px 0px 0px 40px; border: medium; padding: 0px;">#define __STDC_WANT_IEC_60559_TYPES_EXT__</blockquote><div><br></div><div>from each synopsis.</div></div><div><br></div><div><blockquote type="cite"><pre style="white-space: pre-wrap; font-variant-ligatures: normal; orphans: 2; widows: 2; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">
6.2 page 4, line 25: Why does infinity have a higher precedence than
NaN? </pre></blockquote><div>NaN here refers to quiet NaN. Infinity has the higher precedence because |+/-inf| + |x| = +inf for any (finite or infinite) number x. It’s the same reasoning as for hypot(inf, qNaN) = +inf.</div><blockquote type="cite"><pre style="white-space: pre-wrap; font-variant-ligatures: normal; orphans: 2; widows: 2; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">What about SNaN?
</pre></blockquote>These are <math.h> functions so they get the <math.h> specification for signaling NaNs. If the implementation supports signaling NaNs, an sNaN argument should raise “invalid” and return a qNaN.<br><blockquote type="cite"><pre style="white-space: pre-wrap; font-variant-ligatures: normal; orphans: 2; widows: 2; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">
6.3 page 5, line 25: Why does infinity have a higher precedence than
NaN? What about SNaN?
</pre></blockquote>Same as above.<br><blockquote type="cite"><pre style="white-space: pre-wrap; font-variant-ligatures: normal; orphans: 2; widows: 2; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">
7.* Instead of sum and error, would sum and residual be better?
"error" in the Returns section seems misleading.
</pre></blockquote>Use of “error” follows IEEE 754.</div><div><br></div><div>I suppose looking at just the Returns section could be misleading, but a Returns section isn’t the specification. For example, several of the functions in 7.12.9 have a Returns section that just says “The xxx functions return the rounded integer value.” <br><blockquote type="cite"><pre style="white-space: pre-wrap; font-variant-ligatures: normal; orphans: 2; widows: 2; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">
7.0 page 10, line 27: Also independent of flush-to-zero mode.
</pre></blockquote>There’s no flush-to-zero mode recognized by C23 Annex F or TS-4. In only appears once in C23 in a footnote.</div><div><br></div><div>However, TS-5 has an ABRUPT_UNDERFLOW action for its alternate exception handling pragma. This action is specified in 754 and it explicitly affects the augmented arithmetic operations. Our TSes don’t include this part of the specification. We should consider adding it in TS-5.</div><div><br></div><div>- Jim Thomas<br><blockquote type="cite"><pre style="white-space: pre-wrap; font-variant-ligatures: normal; orphans: 2; widows: 2; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">
---
Fred J. Tydeman Tydeman Consulting
<a href="http://mailman.oakapple.net/mailman/listinfo/cfp-interest">tydeman at tybor.com</a> Testing, numerics, programming
+1 (702) 608-6093 Vice-chair of INCITS/C (ANSI "C")
Sample C17+FPCE tests: <a href="http://www.tybor.com/">http://www.tybor.com</a>
Savers sleep well, investors eat well, spenders work forever.
</pre><br></blockquote></div></body></html>