<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">On Oct 17, 2021, at 9:20 PM, David Olsen <<a href="mailto:dolsen@nvidia.com" class="">dolsen@nvidia.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">On an implementation where<span class="Apple-converted-space"> </span><span style="font-family: "Courier New";" class="">double</span>,<span class="Apple-converted-space"> </span><span style="font-family: "Courier New";" class="">long double</span>, and<span class="Apple-converted-space"> </span><span style="font-family: "Courier New";" class="">_Float64</span><span class="Apple-converted-space"> </span>all have the same format of IEEE 64-bit, what is the result type of an operation with operands of<span class="Apple-converted-space"> </span><span style="font-family: "Courier New";" class="">long double</span><span class="Apple-converted-space"> </span>and<span class="Apple-converted-space"> </span><span style="font-family: "Courier New";" class="">_Float64</span>? My reading of the usual arithmetic conversions in section X.4.2 if<span class="Apple-converted-space"> </span><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2601.pdf" style="color: rgb(5, 99, 193); text-decoration: underline;" class="">N2601</a><span class="Apple-converted-space"> </span>is that the result type is<span class="Apple-converted-space"> </span><span style="font-family: "Courier New";" class="">_Float64</span>, because interchange floating types are preferred over standard floating types when the two types have the same sets of values. Is my interpretation correct?</div></div></div></blockquote><div><br class=""></div>Yes.</div><div><br class=""><blockquote type="cite" class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I am working on modifying the C++ floating-point proposal P1467 so that the usual arithmetic conversion rules match those in N2601 and C23, as was requested in the joint SG22/CFP meeting. I am having trouble with this one situation.<o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">On implementations where<span class="Apple-converted-space"> </span><span style="font-family: "Courier New";" class="">long double</span><span class="Apple-converted-space"> </span>is bigger than<span class="Apple-converted-space"> </span><span style="font-family: "Courier New";" class="">double</span>,<span class="Apple-converted-space"> </span><span style="font-family: "Courier New";" class="">long double + _Float64 -> long double</span>. I think the usual arithmetic conversion rules should be consistent so that<span class="Apple-converted-space"> </span><span style="font-family: "Courier New";" class="">long double + _Float64 -> long double</span><span class="Apple-converted-space"> </span>all the time, even when<span class="Apple-converted-space"> </span><span style="font-family: "Courier New";" class="">long double</span><span class="Apple-converted-space"> </span>has the same set of values as<span class="Apple-converted-space"> </span><span style="font-family: "Courier New";" class="">_Float64</span>. This will help users when porting code between implementations that have different representations for<span class="Apple-converted-space"> </span><span style="font-family: "Courier New";" class="">long double</span>. </div></div></blockquote><div><br class=""></div>How specifically would this help? There’s still the issue of long double arithmetic possibly being less robust than _Float64.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> Is it possible to tweak the usual arithmetic conversion rules in C23 to make this change? </div></div></div></blockquote><div><br class=""></div>Are you suggesting that there be a special rule that applies only to long double + _Float64 when they have the same formats?<br class=""><br class=""><blockquote type="cite" class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">(I believe that<span class="Apple-converted-space"> </span><span style="font-family: "Courier New";" class="">long double + _Float64</span><span class="Apple-converted-space"> </span>is the only combination of standard and interchange floating types where the result type can change between conforming implementations. I guess<span class="Apple-converted-space"> </span><span style="font-family: "Courier New";" class="">long double + _Float128 -> long double</span><span class="Apple-converted-space"> </span>if<span class="Apple-converted-space"> </span><span style="font-family: "Courier New";" class="">long double</span><span class="Apple-converted-space"> </span>is bigger than<span class="Apple-converted-space"> </span><span style="font-family: "Courier New";" class="">_Float128</span>, but I don’t think any such implementations exist.)</div></div></blockquote><div><br class=""></div><div>If long double were double-double then long double and _Float128 would be unordered.</div><div><br class=""></div>If all possible C implementation are considered I think there are several exceptions. For example, long double could be narrower than _Float64. (This is not true with strict conformance to the C annex for IEEE floating types.)</div><div><br class=""></div><div>- Jim Thomas</div><div><br class=""></div><div><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">(I have no problem with<span class="Apple-converted-space"> </span><span style="font-family: "Courier New";" class="">double + _Float64 -> _Float64</span>. That makes sense, and I have changed the C++ proposal to do that. It is only<span class="Apple-converted-space"> </span><span style="font-family: "Courier New";" class="">long double + _Float64</span><span class="Apple-converted-space"> </span>that I have an issue with.)<o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> - David Olsen<o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Cfp-interest mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="mailto:Cfp-interest@oakapple.net" style="color: rgb(5, 99, 193); text-decoration: underline; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">Cfp-interest@oakapple.net</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="http://mailman.oakapple.net/mailman/listinfo/cfp-interest" style="color: rgb(5, 99, 193); text-decoration: underline; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">http://mailman.oakapple.net/mailman/listinfo/cfp-interest</a></div></blockquote></div><br class=""></div></div></body></html>