[Cfp-interest 2581] Floating point rounding modes

Hans Boehm boehm at acm.org
Tue Jan 3 14:26:05 PST 2023


I wrote up a preliminary proposal for WG21/C++ to deprecate fesetround()
and friends, and replace it with explicit rounding mode parameters.

Unfortunately, the official WG21 December 15 mailing hasn't yet been put
together, but I believe the paper is unofficially accessible at
https://isocpp.org/files/papers/P2746R0.pdf.

I think rounding modes are currently significantly more broken in C than
C++. But my impression is that many of the same issues also apply in C.

Jim Thomas pointed me at minutes from the last discussion. I'm interested
in what was meant by "Interval arithmetic lends itself to block based
control like upper bounds in one block, lower in another", and the
rationale behind it. My view is that this is a case in which you really
want to control rounding mode on a per-operation basis, and any sort of
scope-based mechanism is unlikely to be helpful.

AFAICT, most use cases that actually aim for guarantees on the output value
(a) need careful per-operation control, and (b) need the interpretation of
constants to reflect the rounding mode. (Or need to very carefully avoid
constants that might not be exactly representable.)

Hans
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20230103/660bfb11/attachment-0001.htm>


More information about the Cfp-interest mailing list