[Cfp-interest 1794] NaN and infinity macros cleanup

Jim Thomas jaswthomas at sbcglobal.net
Mon Oct 19 08:59:57 PDT 2020


Here is a comment from Joseph Myers, in the context of discussing the TS3 annex at the WG14 meeting this months:

> SNAN macros: I think the wording now in C2X about "If an optional unary + 
> or - operator followed by a signaling NaN macro is used as the 
> initializer" (not just if the macro itself is used as an initializer) 
> should be used for the new macros.  In fact I see the current C2X draft 
> only has that applied to FLT_SNAN, DBL_SNAN, LDBL_SNAN, not for the 
> decimal types, but surely + and - should be OK on D32_SNAN, D64_SNAN, 
> D128_SNAN given they are on FLT_SNAN, DBL_SNAN, LDBL_SNAN.  Is that an 
> editorial issue regarding the application of N2406 to the working draft, 
> or does applying that wording to the decimal FP macros need a new paper?



The first part of the comment has been addressed in the Oct 15 version of the TS3 annex.

The second part points to C2X issues ... 

Yes, the optional unary + and - operator should appear in the decimal spec, as Joseph notes. 

In the N2573 C2X draft, the paragraphs 5.2.4.2.2 #16, #18, and #20 belong with the macros for decimal floating point, in 5.2.4.2.3, right after #2. 

The words “signaling NaN macros” and “decimal signaling NaN macros” in 5.2.4.2.2 #15 and #16 in N2573 would be better not italicized. These are not terms that are used elsewhere. The “decimal” is not needed in the second case, once moved into the decimal subclause 5.3.4.2.3. 

Thus 5.2.4.2.2 #16 becomes 5.2.4.2.3 #2a:

[2a] The signaling NaN macros 

D32_SNAN 
D64_SNAN 
D128_SNAN 

each expands to a constant expression of the respective decimal floating type representing a signaling NaN. If an optional unary + or - operator followed by a signaling NaN macro is used for initializing an object of the same type that has static or thread-local storage duration, the object is initialized with a signaling NaN value.

- Jim Thomas












-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20201019/c7cbb8ef/attachment.htm>


More information about the Cfp-interest mailing list