[Cfp-interest 1314] agenda item "Rounding of negated floating constants under FENV_ROUND pragma"

Jim Thomas jaswthomas at sbcglobal.net
Tue May 14 15:26:34 PDT 2019


Here’s an issue I noticed when reviewing the C2X drafts:

Previously, floating constants were always evaluated at translation time, using default rounding. Now, with TS 18661-1 and 2, constant rounding modes set by the FENV_ROUND and FENV_DEC_ROUND pragmas affect floating constants within the scope of the pragma. A C floating constant does not include a sign, which C regards as a unary operator. Thus, rounding of a negated constant (e.g., -0.1) is done before negation, which for rounding up or down is undesirable, and is unlike the treatment of the corresponding string (“-0.1”) by the strtod family as required by F.5. 


- Jim Thomas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20190514/350a8146/attachment.html 


More information about the Cfp-interest mailing list