<font size=2 face="sans-serif">Re the last point, I prefer adding the
words as well for clarity.</font>
<br>
<br><font size=2 face="sans-serif">Regards,<br>
<br>
Rajan Bhakta<br>
z/OS XL C/C++ Compiler Technical Architect<br>
ISO C Standards Representative for Canada<br>
C Compiler Development<br>
Contact: rbhakta@ca.ibm.com, Rajan Bhakta/Toronto/IBM<br>
Telephone: (905) 413-3995</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">From:</font>
<td><font size=1 face="sans-serif">Jim Thomas <jaswthomas@sbcglobal.net></font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">To:</font>
<td><font size=1 face="sans-serif">"Fred J. Tydeman" <tydeman@tybor.com></font>
<tr>
<td valign=top><font size=1 color=#5f5f5f face="sans-serif">Cc:</font>
<td><font size=1 face="sans-serif">CFP <cfp-interest@ucbtest.org></font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Date:</font>
<td><font size=1 face="sans-serif">08/27/2012 07:16 PM</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Subject:</font>
<td><font size=1 face="sans-serif">Re: [Cfp-interest] strtodN subject sequence
with minus sign</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Sent by:</font>
<td><font size=1 face="sans-serif">cfp-interest-bounces@oakapple.net</font></table>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2><br>
On Aug 26, 2012, at 9:36 PM, Fred J. Tydeman wrote:<br>
<br>
> On Tue, 21 Aug 2012 11:36:20 -0700 Jim Thomas wrote:<br>
>> <br>
>>>> <br>
>>>> 11.6 strtod32, strtod64, and strtod128 functions <stdlib.h><br>
>>>> PDF page 31, item [4]:<br>
>>>> Add at the end of: <br>
>>>> "If the subject sequence begins with a minus sign,
the sequence is<br>
>>>> interpreted as negated."<br>
>>>> (before rounding).<br>
>>> <br>
>>> It says the sequence is interpreted as negated, not that the
result of <br>
>> rounding the unnegated sequence is negated. So no change needed<br>
> <br>
> C11 has a footnote on negated. That footnote is:<br>
> <br>
> 292) It is unspecified whether a minus-signed sequence is converted
<br>
> to a negative number directly or by negating the value resulting from
<br>
> converting the corresponding unsigned sequence (see F.5); the two<br>
> methods may yield different results if rounding is toward positive
or <br>
> negative infinity. In either case, the functions honor the sign of
<br>
> zero if floating-point arithmetic supports signed zeros.<br>
> <br>
> That makes it clear the "interpreted as negated" phrase
has two meanings.<br>
<br>
I believe the words give an implementation license to mis-round in this
particular way. This doesn't really seem necessary since C11 without Annex
F doesn't require correct rounding for strtod functions anyway. See below.<br>
<br>
> <br>
>> In the Aug teleconference, David asked would "interpreted
as negative" be <br>
>> better? I think it might be a little clearer. However, the current
words ( <br>
>> negated) match what's in C11 for the generic strtod family. I'm
inclined <br>
>> against making strtodN differ from strtod on this point. Does
anyone think a <br>
>> C11 defect report is in order?<br>
> <br>
> C11 F.5 has:<br>
> <br>
> Functions such as strtod that convert character sequences to floating
<br>
> types honor the rounding direction. Hence, if the rounding direction
<br>
> might be upward or downward, the implementation cannot convert a <br>
> minus-signed sequence by negating the converted unsigned sequence.<br>
<br>
This says that honoring the directed rounding modes requires negating before
rounding. And we require the decimal strto functions to round correctly.<br>
<br>
> <br>
> Since strtod32/64/128 are for IEEE-754 DFP types, F.5 is in effect
and<br>
> I believe we could differ some from strtof/d/ld.<br>
> <br>
> I see no defect in C11.<br>
> <br>
> I prefer adding "(before rounding)".<br>
<br>
I still don't think it's strictly necessary, but wouldn't object to adding
it.<br>
<br>
-Jim<br>
<br>
> <br>
> ---<br>
> Fred J. Tydeman Tydeman Consulting<br>
> tydeman@tybor.com Testing, numerics, programming<br>
> +1 (775) 287-5904 Vice-chair of PL22.11 (ANSI
"C")<br>
> Sample C99+FPCE tests: </font></tt><a href=http://www.tybor.com/><tt><font size=2>http://www.tybor.com</font></tt></a><tt><font size=2><br>
> Savers sleep well, investors eat well, spenders work forever.<br>
> <br>
> _______________________________________________<br>
> Cfp-interest mailing list<br>
> Cfp-interest@oakapple.net<br>
> </font></tt><a href="http://mailman.oakapple.net/mailman/listinfo/cfp-interest"><tt><font size=2>http://mailman.oakapple.net/mailman/listinfo/cfp-interest</font></tt></a><tt><font size=2><br>
<br>
<br>
_______________________________________________<br>
Cfp-interest mailing list<br>
Cfp-interest@oakapple.net<br>
</font></tt><a href="http://mailman.oakapple.net/mailman/listinfo/cfp-interest"><tt><font size=2>http://mailman.oakapple.net/mailman/listinfo/cfp-interest</font></tt></a><tt><font size=2><br>
<br>
</font></tt>
<br>
<br>