<div dir="ltr"><div dir="ltr"><div>This reply expands on the note below regarding fromfp.</div><div class="gmail_quote"><div dir="ltr"><div dir="ltr"><div><br></div><div>The proposed wording to specify a return of positive or unsigned zero whenever the return value is zero may break implementations implemented otherwise, since the original definition of fromfp in C23. The proposal is broadened to include unsigned zero, when that is relevant.</div><div><br></div><div><div>Proposed change to 7.12.10.10p2:</div><div> From:</div><div> . . . then the functions return the integer value (represented in floating type).</div><div><div> To:</div><div> . . . then the functions return the integer value (represented in floating type); a zero return value is always positive or unsigned.</div></div></div><div><br></div><div>Another issue arises in Table F.2 with its bindings of the 10 convertToIntegerXXXXX operations in 60559. The applications of the four variants of [u]fromfp[x] are really compositions of a cast (to the integer type) with the fromfp variant. Here are possible changes:</div><div><br></div><div>For convertToIntegerTiesToEven and its three neighbors, from:</div><div><br></div><div><font face="monospace"> fromfp, ufromfp</font></div><div><div><br></div><div> To:</div><div><br></div><div><font face="monospace"> </font><font face="arial, sans-serif">cast of</font><font face="monospace"> fromfp </font><font face="arial, sans-serif">or</font><font face="monospace"> ufromfp</font></div><div><br></div><div>For convertToIntegerTiesToAway, from:</div><div><br></div><div><font face="monospace"> fromfp, ufromfp, lround, llround</font></div><div><div><br> To:</div><div><br></div><div><font face="monospace"> </font><span style="font-family:monospace">lround, llround, </span><font face="arial, sans-serif">cast of</font><font face="monospace"> fromfp </font><font face="arial, sans-serif">or</font><font face="monospace"> ufromfp</font></div></div><div><div></div><div></div></div><div><div dir="ltr" class="gmail_signature"><div dir="ltr"></div></div></div><div></div><div></div></div><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><br></div><div>For convertToIntegerExactTiesToEven and its four neighbors, from:</div><div><br></div><div><font face="monospace"> fromfpx, ufromfpx</font></div><div><div><br></div><div> To:</div><div><br></div><div><font face="monospace"> </font><font face="arial, sans-serif">cast of</font><font face="monospace"> fromfpx </font><font face="arial, sans-serif">or</font><font face="monospace"> ufromfpx</font></div></div><div><br></div></div><div dir="ltr">-Jerome Coonen<div> 650.996.4738</div><div> <a href="mailto:jcoonen@gmail.com" target="_blank">jcoonen@gmail.com</a></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Feb 14, 2026 at 1:02 PM Jerome Coonen <<a href="mailto:jcoonen@gmail.com" target="_blank">jcoonen@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Greetings,</div><div><br></div><div>Joseph Myers has raised the issue of the sign of a zero result from the fromfp family of functions.</div><div class="gmail_quote"><div dir="ltr"><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>> Do the fromfp functions follow the same rules about the sign of a zero</div><div>> result as all the other functions rounding to an integer in a floating</div><div>> type (i.e., the sign of a zero result is the sign of the floating</div><div>> argument)? In particular, is it correct that the ufromfp functions return</div><div>> -0 when a negative argument rounds to 0? The issue of the sign of a zero</div><div>> result was introduced when we changed these functions to return a floating</div><div>> type for C23 (N2548), but we didn't add any text to the standard</div><div>> discussing it for these functions.</div></blockquote><div><br></div><div>Both the binary and decimal flavors of fromfp take an unsigned int parameter width. Depending on the possible prefix 'u', they specify an integral return value in the floating return type corresponding to an unsigned or a 2's complement signed binary width-bit integer. </div><div><br></div><div>In both unsigned and 2's complement integer representations, zero is mathematical, without algebraic sign. The natural behavior for fromfp is to return +0 when it returns zero, regardless of the input argument and choice of roundings. The integral result of fromfp is the canonical representation of the integer value in a normalized floating format.</div><div><br></div><div>This added wording would clarify the point.</div><div><br></div><div>Proposed change to 7.12.10.10p2:</div><div> From:</div><div> . . . then the functions return the integer value (represented in floating type).</div><div><div> To:</div><div> . . . then the functions return the integer value (represented in floating type); a zero return value is always +0.</div><div><br></div><div>The phrasing is designed to flow into the following conditional text.</div><div><br></div></div><div><div dir="ltr" class="gmail_signature"><div dir="ltr">-Jerome Coonen<div> 650.996.4738</div><div> <a href="mailto:jcoonen@gmail.com" target="_blank">jcoonen@gmail.com</a></div></div></div></div></div>
</div></div>
</blockquote></div></div>
</div></div>
</div>