[Cfp-interest 2793] FP_CONTRACT pragma and <math.h>

Vincent Lefevre vincent at vinc17.net
Tue Jul 4 06:55:35 PDT 2023


Re Cfp-interest 2790

On 2023-07-03 09:16:23 -0700, Jim Thomas wrote:
> 1. C99 pragmas
> 
> FP_CONTRACT
> FENV_ACCESS
> CX_LIMITED_RANGE
> 
> are established. The prefixes reflect what the pragmas control. The
> association of FP_CONTRACT with math.h is questionable, since the
> pragma is about expression evaluation, not math functions.

There are other things in <math.h> that also apply just to
expressions, e.g. the float_t and double_t types (as said later),
and the INFINITY and NAN macros.

It seems that <float.h> is designed to be rather minimal for
freestanding implementations, for which <math.h> is optional.
But this means that there is no portable way to disable the
contraction of floating expressions for such implementations.
Is there anything to do about that?

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the Cfp-interest mailing list