[cfp-interest 3672] Re: Confusingly long sentence in F.3#6

Damian McGuckin damianm at esi.com.au
Mon Oct 20 09:10:50 PDT 2025


Thanks for looking at this Fred.

On Mon, 20 Oct 2025, Fred J. Tydeman wrote:

>> On Sat, 18 Oct 2025, Damian McGuckin wrote:
>>
>>>       The C classification macros fpclassify, iscanonical, isfinite,
>>>       isinf, isnan, isnormal, issignaling, issubnormal, iszero,
>>>       and signbit provide the ISO/IEC 60559 operations indicated in
>>>       Table F.2 provided their arguments are in the format of their
>>>       semantic type.
>>
>> The first 'their', i.e. their argument, refers to the one of those 
>> macros.
>>
>> To what does the second 'their' refer. It cannot again be referring to 
>> the macros as they have no semantic types.

> float can be a double or long double in format (depends upon 
> FLT_EVAL_METHOD). To force a value to be in the format of their semantic 
> type requires a cast to that type.

The word 'provided' is currently used twice in the sentence with two very 
different meanings. And the word 'their' is used to refers to two very
different things, the first to the macro and the second to the argument of 
the macro which is very confusing. Using the use of plural is also very
confusing because these macros have only a single argument.

I think what the above is saying is more like:

 	Each of the C classification macros fpclassify, iscanonical,
 	isfinite, isinf, isnan, isnormal, issignaling, issubnormal,
 	iszero, and signbit provides the ISO/IEC 60559 operation indicated
 	in Table F.2 only if the macro's argument is in the format of its
 	semantic type.

I believe that the way I have written then, the single 'its' now clearly 
refers to the macro's argument. And the multiple meaning of 'provide' has 
disappeared. The questions is whether I have changed the meaning.

One could change "only if" to "as long as".

Finally then, what is the semantic type? It is an undefined term in C2Y.

What is the semantic type of float?  Of double? Of long double? Of int?

> So, 1e-315f could be zero (as a float), subnormal (as a double), or 
> normal (as a long double).

> So, if FLT_EVAL_METHOD is 2
> (float)1e-315f  is zero
> (double)1e-315f is subnormal
> (long double)1e-315f is normal

I thought that 1e-315f is zero by definition if FLT_EVAL_METHOD is 0,
subnormal if FLT_EVAL_METHOD is 1, and normal if FLT_EVAL_METHOD is 2.
Those casts are irrelevant because in the last case for example, if
FLT_EVAL_METHOD is 0, you are casting a zero to a long double.

Thanks again for your feedback - Damian


More information about the cfp-interest mailing list