<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 Jan 16, 2022, at 10:30 AM, 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="">F.10.8.2 The nan functions has:<br class="">2 The returned value is exact and is independent of the current rounding direction mode.<br class=""><br class="">I read that as meaning no floating-point exceptions are raised by the nan() function.<br class=""></div></div></blockquote><div><br class=""></div>That is the intention. It would have been better to say “The nan functions raise no floating-point exception.”</div><div><br class=""></div><div>Note that F.10 #7 says</div><div><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div>The "invalid" and "divide-by-zero" floating-point exceptions are raised as specified in subsequent subclauses of this annex.</div></blockquote><div><br class=""></div><div>and there is no specification for nan() to raise the “invalid” floating-point exception.</div><div><br class=""></div><div>For implementation that don’t support Annex F, I believe the specification for floating-point exceptions is essentially what its implied by the specification for domain, range, and pole errors.</div><div><br class=""></div><div>- Jim Thomas</div><div><br class=""><blockquote type="cite" class=""><div class=""><div class="">However, I have found that (at least) glibc raises FP_INVALID if the string passed<br class="">to nan() has lots of valid characters. Is that a bug in glibc?<br class=""><br 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>