[cfp-interest 3478] Re: frexp() in Annex F
Damian McGuckin
damianm at esi.com.au
Wed May 28 18:57:44 PDT 2025
Hi Vincent,
On Wed, 28 May 2025, Vincent Lefevre wrote:
> I think that both
>
> frexp (NaN, p) returns with an unspecified value in the object
> pointed to by p.
>
> and
>
> frexp (NaN, p) returns a NaN with an unspecified value in the object
> pointed to by p.
Hmmmm. Possibly replace both it and the item prior with
frexp (x, p) returns x with an unspecified value in the object
pointed to by p when x is a NaN or |x| = OO
where OO is my bad attempt at infinity. Should 'when' be a 'for'?
> BTW, there are two other issues:
>
> 1. What is the point of F.10.4.7p2, which says "frexp raises no
> floating-point exceptions if value is not a signaling NaN."?
> There is nothing like that for the other functions.
Yes. Certainly not modf() which is somewhat similar.
> 2. F.10.1p14 "Functions with a NaN argument return a NaN result and
> raise no floating-point exception, except where explicitly stated
> otherwise." is misleading as the recommended practice F.2.2p6 is
>
> Any floating-point operator or <math.h> function or macro with
> a signaling NaN input, unless explicitly specified otherwise,
> raises an "invalid" floating-point exception.
>
> and F.10.4.7p2 could be regarded as something being explicitly
> specified otherwise (since it says "raise no floating-point
> exception").
Looks like a topic for discussion.
Thanks - Damian
More information about the cfp-interest
mailing list