<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>If no one objects, say by Friday, I'll add&nbsp;"(before rounding)".</div><div><br></div><div>-Jim</div><div><br></div><div>On Aug 28, 2012, at 10:11 AM, Rajan Bhakta wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><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: <a href="mailto:rbhakta@ca.ibm.com">rbhakta@ca.ibm.com</a>, Rajan Bhakta/Toronto/IBM<br>
Telephone: (905) 413-3995</font>
<br>
<br>
<br>
<table width="100%">
<tbody><tr valign="top">
<td><font size="1" color="#5f5f5f" face="sans-serif">From:</font>
</td><td><font size="1" face="sans-serif">Jim Thomas &lt;<a href="mailto:jaswthomas@sbcglobal.net">jaswthomas@sbcglobal.net</a>&gt;</font>
</td></tr><tr valign="top">
<td><font size="1" color="#5f5f5f" face="sans-serif">To:</font>
</td><td><font size="1" face="sans-serif">"Fred J. Tydeman" &lt;<a href="mailto:tydeman@tybor.com">tydeman@tybor.com</a>&gt;</font>
</td></tr><tr>
<td valign="top"><font size="1" color="#5f5f5f" face="sans-serif">Cc:</font>
</td><td><font size="1" face="sans-serif">CFP &lt;<a href="mailto:cfp-interest@ucbtest.org">cfp-interest@ucbtest.org</a>&gt;</font>
</td></tr><tr valign="top">
<td><font size="1" color="#5f5f5f" face="sans-serif">Date:</font>
</td><td><font size="1" face="sans-serif">08/27/2012 07:16 PM</font>
</td></tr><tr valign="top">
<td><font size="1" color="#5f5f5f" face="sans-serif">Subject:</font>
</td><td><font size="1" face="sans-serif">Re: [Cfp-interest] strtodN subject sequence
with minus sign</font>
</td></tr><tr valign="top">
<td><font size="1" color="#5f5f5f" face="sans-serif">Sent by:</font>
</td><td><font size="1" face="sans-serif"><a href="mailto:cfp-interest-bounces@oakapple.net">cfp-interest-bounces@oakapple.net</a></font></td></tr></tbody></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>
&gt; On Tue, 21 Aug 2012 11:36:20 -0700 Jim Thomas wrote:<br>
&gt;&gt; <br>
&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt; 11.6 strtod32, strtod64, and strtod128 functions &lt;stdlib.h&gt;<br>
&gt;&gt;&gt;&gt; PDF page 31, item [4]:<br>
&gt;&gt;&gt;&gt; Add at the end of: <br>
&gt;&gt;&gt;&gt; "If the subject sequence begins with a minus sign,
the sequence is<br>
&gt;&gt;&gt;&gt; &nbsp;interpreted as negated."<br>
&gt;&gt;&gt;&gt; (before rounding).<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; It says the sequence is interpreted as negated, not that the
result of <br>
&gt;&gt; rounding the unnegated sequence is negated. So no change needed<br>
&gt; <br>
&gt; C11 has a footnote on negated. &nbsp;That footnote is:<br>
&gt; <br>
&gt; 292) It is unspecified whether a minus-signed sequence is converted
<br>
&gt; to a negative number directly or by negating the value resulting from
<br>
&gt; converting the corresponding unsigned sequence (see F.5); the two<br>
&gt; methods may yield different results if rounding is toward positive
or <br>
&gt; negative infinity. In either case, the functions honor the sign of
<br>
&gt; zero if floating-point arithmetic supports signed zeros.<br>
&gt; <br>
&gt; 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>
&gt; <br>
&gt;&gt; In the Aug teleconference, David asked would "interpreted
as negative" be <br>
&gt;&gt; better? I think it might be a little clearer. However, the current
words ( <br>
&gt;&gt; negated) match what's in C11 for the generic strtod family. I'm
inclined <br>
&gt;&gt; against making strtodN differ from strtod on this point. Does
anyone think a <br>
&gt;&gt; C11 defect report is in order?<br>
&gt; <br>
&gt; C11 F.5 has:<br>
&gt; <br>
&gt; Functions such as strtod that convert character sequences to floating
<br>
&gt; types honor the rounding direction. Hence, if the rounding direction
<br>
&gt; might be upward or downward, the implementation cannot convert a <br>
&gt; 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>
&gt; <br>
&gt; Since strtod32/64/128 are for IEEE-754 DFP types, F.5 is in effect
and<br>
&gt; I believe we could differ some from strtof/d/ld.<br>
&gt; <br>
&gt; I see no defect in C11.<br>
&gt; <br>
&gt; 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>
&gt; <br>
&gt; ---<br>
&gt; Fred J. Tydeman &nbsp; &nbsp; &nbsp; &nbsp;Tydeman Consulting<br>
&gt; <a href="mailto:tydeman@tybor.com">tydeman@tybor.com</a> &nbsp; &nbsp; &nbsp;Testing, numerics, programming<br>
&gt; +1 (775) 287-5904 &nbsp; &nbsp; &nbsp;Vice-chair of PL22.11 (ANSI
"C")<br>
&gt; 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>
&gt; Savers sleep well, investors eat well, spenders work forever.<br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; Cfp-interest mailing list<br>
&gt; <a href="mailto:Cfp-interest@oakapple.net">Cfp-interest@oakapple.net</a><br>
&gt; </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>
<a href="mailto:Cfp-interest@oakapple.net">Cfp-interest@oakapple.net</a><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></blockquote></div><br></body></html>