[Cfp-interest 2692] Re: WG14 IEEE 754-C binding meeting minutes 2023/01/31

Vincent Lefevre vincent at vinc17.net
Thu Feb 9 04:48:11 PST 2023


On 2023-02-06 12:25:25 -0800, Jim Thomas wrote:
> >>> Note that at least 6.3.1.8 "Usual arithmetic conversions" needs to
> >>> be updated to take that into account (and H.4 too?).
> >> 
> >> Why? They are intended to have the behavior of the real type they
> >> are defined to be.
> 
> Some clarification may well be needed, but I think the *_t types are
> intended to defined (as if) by typedef.

Not always. This is what the GNU C library does:

$ printf "#include <math.h>\ndouble_t\n" | gcc -E -xc - | grep double_t
typedef double double_t;
double_t

But...

> 6.7.8 says "A typedef declaration does not introduce a new type,
> only a synonym for the type so specified.” They are synonyms for the
> real types they are defined to be. This is reflected in their
> specification with the standard evaluation methods, e.g. "If
> FLT_EVAL_METHOD equals 0, float_t and double_t are float and double,
> respectively.”

This is well-defined in 7.12 when FLT_EVAL_METHOD is 0, 1 or 2.
Otherwise, they may be entirely new types.

> > BTW, 7.12 "Mathematics <math.h>" says about these types:
> > "floating types at least as wide as float and double", where "real"
> > will be added. However, "as wide as" has not been defined, AFAIK.
> > IMHO, it should be required that these types have the same radix
> > (this is important if FLT_EVAL_METHOD is not 0, 1 or 2, since they
> > are implementation-defined) and the requirement should be about
> > the "range and precision" as for FLT_EVAL_METHOD in 5.2.4.2.2.
> 
> The intended meaning of type A is wider than type B is that the
> values of A are a superset of the values of B and A has greater
> range and/or precision than B. It’s used this way in other places in
> the standard, e.g. 7.6.2 #4 has "(including the conversion of a
> value represented in a format wider than its semantic types to its
> semantic type …)” and 7.12.3.1 #2 has "an argument represented in a
> format wider than its semantic type is converted to its semantic
> type.” A clear statement of meaning would be good, but I believe it
> is generally understood as intended.

I think that I saw some discussions about the exact meaning, and this
was not completely obvious (in particular if a normal value can become
a non-normal one in a "wider" type). So I'm wondering whether there
should be a definition in Clause 3.

Moreover, this could mean that in practice, double-double and binary64
could not be supported at the same time due to the lack of a widest
floating type, as required by the standard (I would not expect a
double-binary64 format to be implemented in practice).

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the Cfp-interest mailing list