<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 12, 2022, at 12:54 PM, Fred J. Tydeman <<a href="mailto:tydeman@tybor.com" class="">tydeman@tybor.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">More thoughts on:<br class=""><br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Some opinions from <a href="http://stackoverflow.com" class="">stackoverflow.com</a> say (since the C standard does not explicitly define the behaviour of flushed<br class="">subnormals), it is undefined behaviour (UB). Other opinions say treat them as another form of zero.<br class=""></blockquote></blockquote><br class="">One idea:<br class="">The C standard does not define the behaviour of<br class=""> integer arithmetic<br class=""> non-decimal floating-point arithmetic<br class="">Does that make it UB?<br class="">Also, why are flushed subnormals special?<br class=""><br class="">On the other hand, C does have in 5.2.4.2.2#8<br class="">The accuracy of the floating-point operations (+ ,- , * , / ) and of the library functions in <math.h><br class="">and <complex.h> that return floating-point results is implementation-defined, as is the accuracy of<br class="">the conversion between floating-point internal representations and string representations performed<br class="">by the library functions in <stdio.h>, <stdlib.h>, and <wchar.h>. The implementation may state<br class="">that the accuracy is unknown. Decimal floating-point operations have stricter requirements.<br class=""><br class="">So, the accuracy of FP operations with subnormals is implementation defined.<br class=""><br class="">Aside: I do not see where the C standard has stricter accuracy requirements for decimal FP.<br class=""></div></div></blockquote><div><br class=""></div>6.10.8.3 has</div><div><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div>__STDC_IEC_60559_DFP__ The integer constant yyyymmL, intended to indicate support of decimal floating types and conformance to Annex F for IEC 60559 decimal floating-point arithmetic.</div></blockquote><div><br class=""></div><div>That is, support for decimal floating types entails support for Annex F which includes the correct rounding requirements of IEC 60559 (except for transcendental functions).</div><div><br class=""></div><div>Also, 6.9#5 says</div><div><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div>Operators involving decimal floating types are evaluated according to the semantics of IEC 60559, including production of results with the preferred quantum exponent as specified in IEC 60559.</div></blockquote><div><br class=""></div><div>Semantic of IEC 60559 include correct rounding.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div class="">5.2.4.2.3#9 does have requirements on quantum exponents.<br class=""><br class="">So, do we need the green part of <a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2797.htm" class="">http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2797.htm</a><br class=""><br class=""></div></div></blockquote><div><br class=""></div>Yes. The green text gives guidance to non-IEC 60559 implementations regarding which values to classify as subnormal.</div><div><br class=""></div><div>- Jim Thomas</div><div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">---<br class="">Fred J. Tydeman Tydeman Consulting<br class=""><a href="mailto:tydeman@tybor.com" class="">tydeman@tybor.com</a> Testing, numerics, programming<br class="">+1 (702) 608-6093 Vice-chair of PL22.11 (ANSI "C")<br class="">Sample C99+FPCE tests: <a href="http://www.tybor.com" class="">http://www.tybor.com</a><br class="">Savers sleep well, investors eat well, spenders work forever.<br class=""><br class="">_______________________________________________<br class="">Cfp-interest mailing list<br class=""><a href="mailto:Cfp-interest@oakapple.net" class="">Cfp-interest@oakapple.net</a><br class="">http://mailman.oakapple.net/mailman/listinfo/cfp-interest<br class=""></div></div></blockquote></div><br class=""></body></html>