[Cfp-interest 1486] Re: Action item: Constant expressions _Float16

Rajan Bhakta rbhakta at us.ibm.com
Tue Feb 18 07:15:51 PST 2020


Sorry, last sentence had a copy/paste error... It is corrected below.

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



From:   "Rajan Bhakta" <rbhakta at us.ibm.com>
To:     Cfp <cfp-interest at oakapple.net>
Date:   02/18/2020 08:26 AM
Subject:        [EXTERNAL] [Cfp-interest 1485]  Action item: Constant 
expressions _Float16
Sent by:        cfp-interest-bounces at oakapple.net



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.

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
_______________________________________________
Cfp-interest mailing list
Cfp-interest at oakapple.net
https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.oakapple.net_mailman_listinfo_cfp-2Dinterest&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=MPb4GyWs7nd-w3OlFPs29W1dB3gHMdsdghhjcQMf428&m=ybPIOgNkMyqf-iLU1qbA2W1BIxURGaOgRMzQPyLF7SU&s=K4h4HMa2hVOEqNdRMDUilYiBOVLNU4QgaUTRB3v9fZ0&e= 





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20200218/5cc17d61/attachment.html 


More information about the Cfp-interest mailing list