<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 27, 2023 at 7:19 AM Vincent Lefevre <<a href="mailto:vincent@vinc17.net">vincent@vinc17.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2023-01-05 12:00:39 -0800, Hans Boehm wrote:<br>
> In the explicit rounding mode case, I agree the syntax is not beautiful.<br>
> On the other hand, for an isolated instance, in the best (AFAICT,<br>
> not yet implemented?) case, I think we currently have something<br>
> like:<br>
> <br>
> {<br>
> #pragma STDC FENV_ROUND FE_TOWARDZERO;<br>
> z = x + y;<br>
> }<br>
> <br>
> I would prefer<br>
> <br>
> z = cr_add (x, y, FE_TOWARDZERO);<br>
> <br>
> unless lots of consecutive operations use the same rounding mode, for which<br>
> I haven't seen a particularly strong use case.<br>
<br>
However, you could define an inline function cr_add_rz using the<br>
former syntax.<br>
<br></blockquote><div>Yes.</div><div>The potential advantage of the functional notation is that it's much less intrusive on the implementation, though in C that argument may apply mostly to the version of the proposal that does not introduce a new type. We're potentially just adding some library code.</div><div>AFAICT, a significant problem with the current and proposed facilities is that they are so rarely used that implementations commonly don't pay enough attention to them. I think many implementations don't properly handle FENV_ACCESS correctly, so I have relatively little confidence in FENV_ROUND, especially since I think we agree it still doesn't handle constants. I also have my doubts about FENV_ROUND in C++. I think there is currently not even a proposal to add it there?</div><div><br></div><div>Hans</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
-- <br>
Vincent Lefèvre <<a href="mailto:vincent@vinc17.net" target="_blank">vincent@vinc17.net</a>> - Web: <<a href="https://www.vinc17.net/" rel="noreferrer" target="_blank">https://www.vinc17.net/</a>><br>
100% accessible validated (X)HTML - Blog: <<a href="https://www.vinc17.net/blog/" rel="noreferrer" target="_blank">https://www.vinc17.net/blog/</a>><br>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)<br>
_______________________________________________<br>
Cfp-interest mailing list<br>
<a href="mailto:Cfp-interest@oakapple.net" target="_blank">Cfp-interest@oakapple.net</a><br>
<a href="http://mailman.oakapple.net/mailman/listinfo/cfp-interest" rel="noreferrer" target="_blank">http://mailman.oakapple.net/mailman/listinfo/cfp-interest</a><br>
</blockquote></div></div>