[Cfp-interest 1337] AI for note about negative constants

Jim Thomas jaswthomas at sbcglobal.net
Sat Jun 22 10:58:20 PDT 2019


Action item:
>     Jim: Draft a note to warn about CFP1315's rounding of negative constants issue.
> 


Here’s a draft note to go at the end of 6.4.4.2:

NOTE	Floating constants do not include a sign and are negated by the unary - operator (6.5.3.3) which negates the rounded value of the constant. In contrast, the numeric conversion functions in the strto family (7.22.1.5, 7.22.1.6) include the sign as part of the input value and convert and round the negated input. Negating before rounding and negating after rounding yield the same result with rounding to nearest and rounding toward zero, but yield different inexact results with rounding toward positive infinity and rounding toward negative infinity. Exact results require no rounding, so are not affected by the order of negating and rounding. For radix 10 types, floating constants expressed within the precision of the evaluation format convert exactly. For radix 2 types, hexadecimal floating constants expressed within the precision of the evaluation format convert exactly.

Comments and suggestions for improvement are welcome.

- Jim Thomas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20190622/a1a1d601/attachment-0001.html 


More information about the Cfp-interest mailing list