<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;"><br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Aug 14, 2024, at 3:28 PM, Fred J. Tydeman <tydeman@tybor.com> wrote:</div><br class="Apple-interchange-newline"><div><div>On Wed, 14 Aug 2024 10:11:55 -0500 (COT) Fred J. Tydeman wrote:<br><blockquote type="cite"><br>Subject: [SC22WG14.26260] Can nan set errno?<br></blockquote><br>7.5 Errors <errno.h> has the general statement:<br><br>The value of errno may be set to nonzero by a library function call<br>whether or not there is an error, provided the use of errno is not<br>documented in the description of the function in this document.<br><br>7.12.2 Treatment of error conditions has several specific statements<br>that apply to all <math.h> functions. So, overrides the 7.5 general<br>statement. <br><br>nan() is a <math.h> function, but is not a mathematical function.<br>strtod() is not a <math.h> function; but it has words about<br>overflow and underflow in the Returns section (that mirror 7.12.2).<br><br>So, what should happen for <br> nan("a_very_long_string_________");<br> strtod("NAN(a_very_long_string_________)", nullptr);<br>when the n-char-sequence is longer than what the nan returned can hold?<br></div></div></blockquote><div><br></div><div>As stated in the <b>strtod</b> Description (7.24.2.6 #5), "the meaning of the n-char sequence is implementation-defined.” In particular, it does not need to be represented in the return NaN. An implementation is free to return the same NaN for all n-char sequences.</div><div><br></div><div>- Jim Thomas</div><div><br></div><blockquote type="cite"><div><div><br><br>---<br>Fred J. Tydeman Tydeman Consulting<br>tydeman@tybor.com Testing, numerics, programming<br>+1 (702) 608-6093 Vice-chair of INCITS/C (ANSI "C")<br>Sample C17+FPCE tests: http://www.tybor.com<br>Savers sleep well, investors eat well, spenders work forever.<br><br>_______________________________________________<br>Cfp-interest mailing list<br>Cfp-interest@oakapple.net<br>http://mailman.oakapple.net/mailman/listinfo/cfp-interest<br></div></div></blockquote></div><br></body></html>