[cfp-interest 3444] Re: [[reproducible]] EXAMPLE 3 in 6.7.13.8
JeanHeyd Meneide
phdofthehouse at gmail.com
Thu Apr 17 08:31:19 PDT 2025
On Mon, Apr 14, 2025 Jim Thomas <jaswthomas at sbcglobal.net> wrote:
> ...
>
> The function could be written so that it doesn’t change the flags, e.g.
> with
>
> #pragma STDC FP_CONTRACT OFF
> #pragma STDC FENV_ACCESS ON
> fenv_t save_env;
> double d;
> fegetenv(&save_env);
> fesetenv(FE_DFL_ENV);
> double d = sqrt(x[0]*x[0] + x[1]*x[1]);
> fesetenv(&save_env);
> return d;
>
> Of course that would mean the function wouldn’t report floating-point
> exceptions.
>
> (TS 18661-5 has #pragma STDC FENV_EXCEPT FE_ALL_EXCEPT NO_FLAG which
> means functions inside don’t set flags.)
>
Is it okay if I made this change editorially to the example code, with
CFP's approval? As it's an example and non-normative, I imagine everyone
would prefer it's strictly correct according to the specification. But I'm
also okay with a paper (if someone wants to take on that kind of burden.)
Sincerely,
JeanHeyd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20250417/8326b56a/attachment.htm>
More information about the cfp-interest
mailing list