[Cfp-interest] NaNQ, NaNS

Fred J. Tydeman tydeman at tybor.com
Thu Jul 26 16:38:22 PDT 2018


On Wed, 25 Jul 2018 11:24:55 -0500 Rajan Bhakta wrote:
>
>      NaNQ/NaNS proposal:
>
>        Look at current 754 draft to see if NaNQ/NaNS violates it.
>
754: 5.12.1: 
Conversion of a quiet NaN in a supported format to an external character sequence shall produce a
language-defined one of "nan" or a sequence that is equivalent except for case (e.g., "NaN"), with an
optional preceding sign. (This standard does not interpret the sign of a NaN.)

Conversion of a signaling NaN in a supported format to an external character sequence should produce a
language-defined one of "snan" or "nan" or a sequence that is equivalent except for case, with an optional
preceding sign. If the conversion of a signaling NaN produces "nan" or a sequence that is equivalent except
for case, with an optional preceding sign, then the invalid operation exception should be signaled.

Conversion of an external character sequence "snan" (regardless of case) with an optional preceding sign,
to a supported format should either produce a signaling NaN or else produce a quiet NaN and signal the
invalid operation exception.


Since the above is 'should', not 'shall', NaNS is allowed by 754.
However, NaNQ is not allowed.

C99/C11/C17 allow for NaN(Q) and NaN(S), but not NaNQ and NaNS.


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