[Cfp-interest 2796] Re: FP_CONTRACT pragma and <math.h>

Jim Thomas jaswthomas at sbcglobal.net
Tue Jul 4 15:08:17 PDT 2023



> On Jul 4, 2023, at 6:55 AM, Vincent Lefevre <vincent at vinc17.net> wrote:
> 
> 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?

Clause 4 #7 allows use of FP_CONTRACT on freestanding implementations that support Annex F.

- Jim Thomas

> 
> -- 
> 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)
> _______________________________________________
> Cfp-interest mailing list
> Cfp-interest at oakapple.net
> http://mailman.oakapple.net/mailman/listinfo/cfp-interest




More information about the Cfp-interest mailing list