<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></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 Aug 21, 2019, at 10:51 AM, Fred J. Tydeman &lt;<a href="mailto:tydeman@tybor.com" class="">tydeman@tybor.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On Thu, 15 Aug 2019 10:40:09 -0700 (PDT) Fred J. Tydeman wrote:<br class=""><blockquote type="cite" class=""><br class="">On Wed, 14 Aug 2019 10:56:01 -0700 Jim Thomas wrote:<br class=""><blockquote type="cite" class=""><br class="">[+/-]SNANF isn't subject to the usual arithmetic conversions<br class=""></blockquote><br class="">Where is that stated?<br class=""><br class=""><blockquote type="cite" class="">and isn't a floating constant,<br class=""></blockquote><br class="">Agreed, it is a constant expression.<br class=""></blockquote><br class="">How can you get a float constant expression without the use of a float constant?<br class=""></div></div></blockquote><div><br class=""></div>A very good question. Yes, it’s a constant expression. C 6.6 says</div><div><br class=""></div><div><blockquote type="cite" class=""><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal;" class="">An arithmetic constant expression shall have arithmetic type and shall only have operands that are</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal;" class="">integer constants, floating constants, enumeration constants, character constants, <span style="font-stretch: normal; font-size: 9px; line-height: normal;" class="">sizeof </span>expressions</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal;" class="">whose results are integer constants, and <span style="font-stretch: normal; font-size: 9px; line-height: normal;" class="">_Alignof </span>expressions.</div></blockquote></div><div><br class=""></div><div>And we say the SNAN macros expand to constant expressions of the appropriate floating type. The NAN and INFINITY macros are similar. But floating constants just represent numbers, not NaNs or infinities. An expression with floating constant operands can’t evaluate to a signaling NaN. Expressions with floating constant operands can evaluate to a quiet NaN or an infinity, but not without an exception. My understanding, for IEC 60559 implementations, is that these macros are not intended to raise exceptions and need to be implemented as compiler symbols.</div><div><br class=""></div><div>For the SNAN macros, instead of</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space: pre;">        </span>…&nbsp;expand to&nbsp;a constant expression of the respective type representing ...</div><div><br class=""></div><div>we might say</div><div><br class=""></div><div><div><span class="Apple-tab-span" style="white-space: pre;">        </span>…&nbsp;expand to&nbsp;an expression of the respective type representing ... They may be used wherever a constant expression of the respective type may be used.</div><div class=""><br class=""></div></div><div><div><br class=""></div></div><div>For the infinity and quiet NaN macros, instead of</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>…&nbsp;expands to a constant expression of type float representing ...</div><div><br class=""></div><div>we might say</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>…&nbsp;expands to an expression of type float representing … It may be used wherever a constant expression of type float may be used.</div><div><br class=""></div><div>And similarly for the decimal macros.</div><div><br class=""></div><div>- Jim Thomas</div><div><br class=""></div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class=""><br class="">---<br class="">Fred J. Tydeman &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tydeman Consulting<br class=""><a href="mailto:tydeman@tybor.com" class="">tydeman@tybor.com</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Testing, numerics, programming<br class="">+1 (702) 608-6093 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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=""></div></div></blockquote></div><br class=""></body></html>