<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;"><div><blockquote type="cite"><div>On Jan 31, 2023, at 7:59 AM, Vincent Lefevre <vincent@vinc17.net> wrote:</div><br class="Apple-interchange-newline"><div><div>On 2023-01-31 07:30:34 -0800, Jim Thomas wrote:<br><blockquote type="cite">Maybe<br><br>All floating constants of the same source form shall convert to the<br>same internal format and, provided they are subject to the same<br>translation-time rounding direction (either the default or a<br>constant rounding mode other that FE_DYNAMIC set by an FENV_ROUND<br>or FENV_DEC_ROUND pragma), to the same value.<br><br>But that would suggest that same-form floating constants could have<br>different values under FE_DYNAMIC. Setting to FE_DYNAMIC should not<br>affect the translation time conversion of floating constants in that<br>they would still get default translation-time rounding.<br></blockquote><br>This is not what 7.6.2p4 says. At the end of this paragraph:<br>"Floating constants (6.4.4.2) of a standard floating type<br>that occur in the scope of a constant rounding mode shall be<br>interpreted according to that mode."<br><br>So, the dynamic rounding mode will be used in this case.<br><br>Or perhaps 7.6.2p4 should be changed.<br></div></div></blockquote><div><br></div>As noted at the CFP meeting today …</div><div><br></div><div>An FENV_ROUND pragma with direction FE_DYNAMIC doesn’t establish a constant rounding mode, though in a few places the spec implies or suggests it does. For example, 7.6.2 #3 has “ … or the specified constant rounding mode is FE_DYNAMIC”.</div><div><br></div><div>For FENV_DEC_ROUND, 7.6.3 #2 says "dec-direction shall be one of the decimal rounding direction macro names (FE_DEC_DOWNWARD, FE_DEC_TONEAREST, FE_DEC_TONEARESTFROMZERO, FE_DEC_TOWARDZERO, and FE_DEC_UPWARD) defined in 7.6, to specify a constant rounding mode, or FE_DEC_DYNAMIC, to specify dynamic rounding.” There should be similar words for FENV_ROUND.</div><div><br></div><div>Here’s a draft for changes to clarify that FE_DYNAMIC does not establish a constant rounding mode:</div><div><br></div><div><a href="https://wiki.edg.com/pub/CFP/WebHome/Floating_constants_issue-20230131.pdf">https://wiki.edg.com/pub/CFP/WebHome/Floating_constants_issue-20230131.pdf</a><br></div><div><br></div><div>- Jim Thomas</div><div><br><blockquote type="cite"><div><div><br><blockquote type="cite"><blockquote type="cite">BTW, is there a way to restore the static rounding mode when<br>outside external declarations? This would be important if one<br>wants to use this pragma in a header file.<br></blockquote><br>It can be “restored" to FE_DYNAMIC which serves as a “default”.<br></blockquote><br>See above. This is not the default for constants.<br><br>-- <br>Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/><br>100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/><br>Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)<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>