[Cfp-interest 2334] Re: nan("1111111111111111111111....")

Jim Thomas jaswthomas at sbcglobal.net
Sun Jan 16 14:51:18 PST 2022



> On Jan 16, 2022, at 10:30 AM, Fred J. Tydeman <tydeman at tybor.com> wrote:
> 
> F.10.8.2 The nan functions has:
> 2 The returned value is exact and is independent of the current rounding direction mode.
> 
> I read that as meaning no floating-point exceptions are raised by the nan() function.

That is the intention. It would have been better to say “The nan functions raise no floating-point exception.”

Note that F.10 #7 says

The "invalid" and "divide-by-zero" floating-point exceptions are raised as specified in subsequent subclauses of this annex.

and there is no specification for nan() to raise the “invalid” floating-point exception.

For implementation that don’t support Annex F, I believe the specification for floating-point exceptions is essentially what its implied by the specification for domain, range, and pole errors.

- Jim Thomas

> However, I have found that (at least) glibc raises FP_INVALID if the string passed
> to nan() has lots of valid characters.  Is that a bug in glibc?
> 
> 
> ---
> Fred J. Tydeman        Tydeman Consulting
> tydeman at tybor.com      Testing, numerics, programming
> +1 (702) 608-6093      Vice-chair of PL22.11 (ANSI "C")
> Sample C99+FPCE tests: http://www.tybor.com
> Savers sleep well, investors eat well, spenders work forever.
> 
> _______________________________________________
> Cfp-interest mailing list
> Cfp-interest at oakapple.net
> http://mailman.oakapple.net/mailman/listinfo/cfp-interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20220116/3446de50/attachment.htm>


More information about the Cfp-interest mailing list