[Cfp-interest 1623] Re: TS3 annex review

Jim Thomas jaswthomas at sbcglobal.net
Fri Jun 5 11:55:18 PDT 2020



> On Jun 4, 2020, at 9:32 PM, Fred J. Tydeman <tydeman at tybor.com> wrote:
> 
> On Thu, 4 Jun 2020 16:31:26 -0700 Jim Thomas wrote:
>> 
>> My understanding 
>> 
>> A is a subset of B iff every element of A is an element of B. The C standard has several instances of "subset" with this meaning.
>> 
>> A is a strict subset of B iff A is a subset of B and A is not equivalent to B.
>> 
>> "Strict subset" and "proper subset" mean the same thing.  An internet search indicates that both terms are widely used and mean the same thing.
> 
> Agree with all of above.
> 
>> In the TS3 there are instances of "is a subset of (or equivalent to)". The parenthetical part isn't really needed (which is why it's in parentheses). We're trying to be extra clear that we don't mean just strict subset.
>> 
> 
> Annex X has for FLT_EVAL_METHOD:
> 
> "0 evaluate all operations and constants, whose semantic type comprises a set of values
>    that is a strict subset of the values of float, to the range and precision of float;"
> 
> So, "float op float" is not evaluated to "float" as per that (which struck me as strange).

The first statement doesn’t say how operations with semantic type float are evaluated. It applies only if the the values of the type are a strict subset of the value of float. In fact, the only TS3 type it applies to is _Float16. It could apply if the implementation had another narrow extension type.
> 
> However, it is evaluated to "float" by the second clause:
> 
> "evaluate all other operations and constants to the range and precision of the semantic
> type;"

Right. This is the statement that applies to float.
> 
> So, perhaps removing "strict" would improve things.

We recently changed this part so that it would not evaluate to a type different from the semantic type if both these types have the same values. For example, _Float32 op _Float32 now evaluates to _Float32, not float. This change was made to avoid surprises in the definitions of the _t types, which match the evaluation types. Removing “strict” would defeat the purpose of the change.

- Jim

> 
> ---
> 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.




More information about the Cfp-interest mailing list