[Cfp-interest 1485] Action item: Constant expressions _Float16
Rajan Bhakta
rbhakta at us.ibm.com
Tue Feb 18 06:24:11 PST 2020
For my action item:
Rajan: Ensure casting to _Float16 won't cause a problem with the using
INFINITY wherever a constant expression can be used change we proposed.
>From 6.6p1, it fits the description.
>From 6.6p3 and 4 (constraints), none are violated.
>From 6.6p6 has floating constants as immediate operands of casts which
applies if INFINITY is a floating constant.
>From 6.6p8 has casts on converting arithmetic to arithmetic types which
fits this case as _Float16 is an interchange type which is a real floating
type which is a floating type which is an arithmetic type, and INFINITY
has a real floating type.
>From 6.4.4.2 it says INFINITY is not directly a floating constant (from
the grammar). It needs to be constructed out of a digit-sequence or some
other means.
>From 6.6p10, implementations can support other constant expressions. This
catch-all seems to allow nearly anything.
>From 7.12p4 it says INFINITY IS a constant expression.
So given 7.12p4 + 6.6p8 I would say that casting to _Float16 will not
cause a problem as long as _Float16.
Regards,
Rajan Bhakta
z/OS XL C/C++ Compiler Technical Architect
ISO C Standards Representative for Canada, PL22.11 Chair (USA)
C Compiler Development
Contact: rbhakta at us.ibm.com, Rajan Bhakta/Houston/IBM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20200218/ba95f8c0/attachment.html
More information about the Cfp-interest
mailing list