[cfp-interest 3560] Re: C23 possible defect: output bounds of imprecise math functions

Jim Thomas jaswthomas at sbcglobal.net
Sat Aug 9 15:39:28 PDT 2025


Paul,

Thanks for the correction!

Note that ISO/IEC 60559 9.2.1 says

For some formats under some rounding attributes the rounded magnitude range of atan (atan2) might exceed the unrounded magnitude of π/2 (π). A programmer must then take care to properly handle any anomalous manifold jump that might occur under the inverse operation.

prioritizing correct rounding over range bounds. I’m not aware of any place that ISO/IEC 60559 makes an exception to correct rounding for its floating-point operation to preserve a property of the corresponding mathematical operation. 

- Jim


> On Jul 18, 2025, at 11:36 PM, Paul Zimmermann <Paul.Zimmermann at inria.fr> wrote:
> 
>> Correctly rounded functions, e.g. sqrt(x) per Annex F, won’t return out-of-range values. C reserves cr_ prefixed names for correctly rounded math functions.
> 
> however correct rounding is not always compatible with range constraints,
> see the example in section 6.4 from https://dl.acm.org/doi/pdf/10.1145/3747840.
> 
> Maybe the CFP group might decide what to do in that case.
> 
> Paul

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20250809/5474307e/attachment-0001.htm>


More information about the cfp-interest mailing list