<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=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Feb 19, 2018, at 8:59 AM, Fred J. Tydeman &lt;<a href="mailto:tydeman@tybor.com" class="">tydeman@tybor.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">18661-2 quantize has<br class=""> &nbsp;Nothing about non-canonical encodings. &nbsp;<br class=""></div></div></blockquote><div><br class=""></div>We need a general statement about functions delivering canonical results unless specified otherwise. We say this implicitly through the binding with IEC 60559, but it would be good say it explicitly. It could go in part 1, which introduces the concept of canonical representations into C. 5.2.4.2.2#5a ends with: "Typically,&nbsp;floating-point operations deliver results with canonical representations.” We could append something like: “IEC 60559 operations deliver results with canonical representations, unless specified otherwise."&nbsp;</div><div><br class=""><blockquote type="cite" class=""><div class=""><div class=""> &nbsp;Nothing about overflow.</div></div></blockquote><div><br class=""></div>The last sentence of the Description could say: The&nbsp;quantize&nbsp;functions do not raise the ”overflow” or “underflow” floating-point exception.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div class=""> &nbsp;Nothing about 'invalid' (which would be in Annex F).<br class=""></div></div></blockquote><div><br class=""></div>The decimal functions are intended to be specified in 7.12 to have IEC 60559 behavior. That is, all implementations that choose to provide them must follow IEC 60559. This means we should be able to give the entire specification in 7.12 without saying anything more in Annex F. Note that the Description of the quantize functions states the requirement for” inexact". It could do the same for “invalid":</div><div><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div>[2]&nbsp;The&nbsp;quantizedN&nbsp;functions compute, if possible, a value with&nbsp;the numerical value of&nbsp;x&nbsp;and the quantum exponent of&nbsp;y.&nbsp;If the quantum exponent is being&nbsp;increased, the value&nbsp;shall be correctly rounded; if the result does not have the same value as&nbsp;x, the “inexact” floating-point exception shall be raised. If the&nbsp;quantum exponent is being decreased and the significand of the result has more&nbsp;digits than the type would allow, the result is NaN, the “invalid” floating-point exception is raised, and a domain error&nbsp;occurs.&nbsp;If one or both operands are NaN the result is NaN. Otherwise if only one&nbsp;operand is infinite, the result is NaN, the “invalid” floating-point exception is raised, and a domain error occurs. If both&nbsp;operands are infinite, the result is&nbsp;DEC_INFINITY&nbsp;with the sign of&nbsp;x,&nbsp;converted to the type of the function. The&nbsp;quantize&nbsp;functions do not raise the”overflow” or&nbsp;“underflow” floating-point exceptions.</div></blockquote><div><br class=""></div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class=""><div class="">754 has in 5.3.2<br class=""> ...this operation shall not propagate non-canonical encodings:<br class=""> quantize does not signal underflow or overflow.<br class=""> Otherwise if only one operand is infinite then the invalid operation<br class=""> exception is signaled and the result is a NaN.<br class=""><br class="">18661-2 llquantexp has<br class=""> &nbsp;Nothing about 'invalid' for infinite and NaN (which would be in Annex F).<br class=""></div></div></blockquote><div><br class=""></div>Following the approach above:</div><div><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div>[2] The&nbsp;llquantexpdN&nbsp;functions compute the quantum&nbsp;exponent (5.2.4.2.2a) of a finite argument. If&nbsp;x&nbsp;is infinite or NaN, they compute&nbsp;LLONG_MIN, the “invalid” floating-point exception is raised,&nbsp;and a&nbsp;domain error occurs.</div><div><br class=""></div></blockquote>- Jim Thomas<div class=""><br class=""><div><blockquote type="cite" class=""><div class=""><div class=""><br class=""><br class="">---<br class="">Fred J. Tydeman &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tydeman Consulting<br class=""><a href="mailto:tydeman@tybor.com" class="">tydeman@tybor.com</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Testing, numerics, programming<br class="">+1 (702) 608-6093 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Vice-chair of PL22.11 (ANSI "C")<br class="">Sample C99+FPCE tests: <a href="http://www.tybor.com" class="">http://www.tybor.com</a><br class="">Savers sleep well, investors eat well, spenders work forever.<br class=""><br class="">_______________________________________________<br class="">Cfp-interest mailing list<br class=""><a href="mailto:Cfp-interest@oakapple.net" class="">Cfp-interest@oakapple.net</a><br class="">http://mailman.oakapple.net/mailman/listinfo/cfp-interest<br class=""><br class=""></div></div></blockquote></div><br class=""></div></body></html>