<div dir="ltr"><div dir="ltr">On Mon, Apr 14, 2025 Jim Thomas <<a href="mailto:jaswthomas@sbcglobal.net">jaswthomas@sbcglobal.net</a>> wrote:</div><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div dir="auto"><div><div>...</div><div><br></div><div>The function could be written so that it doesn’t change the flags, e.g. with</div><div><br></div><div><font face="Courier New">#pragma STDC FP_CONTRACT OFF</font></div><div><font face="Courier New">#pragma STDC FENV_ACCESS ON</font></div><div><font face="Courier New">fenv_t save_env;</font></div><div><font face="Courier New">double d;</font></div><div><font face="Courier New">fegetenv(&save_env);</font></div><div><font face="Courier New">fesetenv(FE_DFL_ENV);</font></div><div><font face="Courier New">double d = sqrt(x[0]*x[0] + x[1]*x[1]);</font></div><div><font face="Courier New">fesetenv(&save_env);</font></div><div><font face="Courier New">return d;</font></div><div><br></div><div>Of course that would mean the function wouldn’t report floating-point exceptions.</div><div><br></div><div>(TS 18661-5 has <font face="Courier New">#pragma STDC FENV_EXCEPT FE_ALL_EXCEPT NO_FLAG</font> which means functions inside don’t set flags.)</div></div></div></div></blockquote><div><br></div><div>     Is it okay if I made this change editorially to the example code, with CFP's approval? As it's an example and non-normative, I imagine everyone would prefer it's strictly correct according to the specification. But I'm also okay with a paper (if someone wants to take on that kind of burden.)<br><br></div><div>Sincerely,<br></div><div>JeanHeyd</div></div></div>