[cfp-interest 3657] Re: C2Y's canonicalise() in AnnexF - F.10.9.7
Damian McGuckin
damianm at esi.com.au
Tue Oct 14 15:11:08 PDT 2025
I suggested:
>>> F.10.9.7#1 The canonicalize functions
>>>
>>> - canonicalize (cx, x) returns a quiet NaN in the object pointed to by cx
>>> and raises the "invalid" floating-point exception when the object pointed
>>> to by x is a signaling NaN .
>>> - canonicalize (cx, x) returns a quiet NaN in the object pointed to by cx
>>> when the object pointed to by x is a quiet NaN .
On Tue, 14 Oct 2025, Jim Thomas wrote:
>
> Not a rewording. Clause 7 does not require the function to be
> successful: simply returning 1 would be a valid implementation. F.10.9.7
> requires the function to store a canonical representation, per ISO/IEC
> 60559, and return 0.
>
> The suggestion above omits the recommendation that signaling NaN input
> result in a quiet NaN "which should be the canonical version of that
> signaling NaN made quiet?.
I believe you are saying that I need to add words to the affect that:
a) F.10.9.7 always stores a canonical represention per ISO/IEC 60559,
i.e. it must always be successful,
b) the recommendation that signaling NaN input result in a quiet NaN
"which should be the canonical version of that signaling NaN made
quiet".
If the pointer is invalid, the routine will fail so I cannot see how I can
uncategorically say (a). What about a qualification in a second paragraph
like:
In the event that cx is a valid pointer, ISO/IEC 60559 mandates
that the canonical representation MUST be returned.
As far as (b) is concerned, I read Section 7 (see below) and I thought
that this has been said already. If Section 7 does not say this, should
not that recommendation belong in Section 7, not Annex F? And what words
do you suggest?
Thanks - Damian
This is Section 7:
The canonicalize functions attempt to produce a canonical version of
the floating-point representation in the object pointed to by the
argument x , as if to a temporary object of the specified type, and
store the canonical result in the object pointed to by the argument cx
. 287) If the input *x is a signaling NaN, the canonicalize functions
are intended to store a canonical quiet NaN. If a canonical result is
not produced the object pointed to by cx is unchanged.
This is Annex F
The canonicalize functions produce 451) the canonical version of the
representation in the object pointed to by the argument x . If the input
*x is a signaling NaN, the "invalid" floating-point exception is raised
and a (canonical) quiet NaN (which should be the canonical version of
that signaling NaN made quiet) is produced. For quiet NaN, infinity,
and finite inputs, the functions raise no floating-point exceptions.
Looking at Annex F:
> The canonicalize functions produce the canonical version of the
> representation in the object pointed to by the argument x.
This is already said in Section 7, albeit qualified by the word "attempt"
> If the input *x is a signaling NaN, the "invalid" floating-point exception
> is raised ...
This is normative - why say it again.
> For quiet NaN, infinity, and finite inputs, the functions raise no
> floating-point exceptions.
This is normative - why say it again.
Thanks - Damian
More information about the cfp-interest
mailing list