<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 Aug 18, 2021, at 8:25 AM, Vincent Lefevre <<a href="mailto:vincent@vinc17.net" class="">vincent@vinc17.net</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On 2021-08-17 14:02:43 -0500, Rajan Bhakta wrote:<br class=""><blockquote type="cite" class="">    Number classification and normal numbers (See CFP2091-3, CFP2096).<br class=""></blockquote>[...]<br class=""><blockquote type="cite" class="">      Fred: There is also supernormal (double double has it). Do you know<br class="">if DBL_MAX + DBL_MAX is a finite number instead of an infinity.<br class=""></blockquote><br class="">Because the absolute value of the second component of a double-double<br class="">number must be less than or equal to 1/2 ulp of the first component,<br class=""></div></div></blockquote><div><br class=""></div>Does this mean all arithmetic operations preserve the property? Are the operations undefined for other inputs?</div><div><br class=""><blockquote type="cite" class=""><div class=""><div class="">DBL_MAX + DBL_MAX is an invalid representation (trap representation<br class="">in the C terminology).<br class=""><br class="">However, due to a representation issue with the maximum exponent,<br class="">the maximum representable finite floating-point number LDBL_MAX is<br class="">strictly larger than the maximum normalized floating-point number<br class="">(which is close to DBL_MAX/2).<br class=""><br class="">With GCC on PowerPC (double-double), where the precision is 106,<br class=""></div></div></blockquote><div><br class=""></div>The double-double described in </div><div><br class=""></div><div><a href="http://mrob.com/pub/math/f161.html" class="">http://mrob.com/pub/math/f161.html</a></div><div><br class=""></div><div>claims the precision is 107, with the extra bit coming from the way the sign of the low component is used.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">LDBL_MAX = 0x1.fffffffffffff7ffffffffffff8p+1023<br class=""><br class="">which is<br class="">           0x1.fffffffffffffp+1023<br class="">         + 0x0.00000000000007ffffffffffff8p+1023<br class=""><br class="">though I would rather expect DBL_MAX + DBL_MAX * DBL_EPSILON / 4<br class="">= 0x1.fffffffffffff7ffffffffffffcp+1023, i.e. with an additional<br class="">trailing 1. I don't see why this would be a trap representation.<br class=""><br class="">However, the maximum normalized floating-point number is<br class="">0x1.ffffffffffffffffffffffffff8p+1022, or equivalently,<br class="">0x0.ffffffffffffffffffffffffffcp+1023, which is<br class=""><br class="">           0x1.0000000000000p+1023<br class="">         - 0x0.000000000000000000000000004p+1023<br class=""><br class="">There's another issue:<br class=""><br class="">  FLT_MAX_EXP<br class="">  DBL_MAX_EXP<br class="">  LDBL_MAX_EXP<br class=""><br class="">are defined in th current C2x draft (N2596) as<br class=""><br class="">  maximum integer such that FLT_RADIX raised to one less than that<br class="">  power is a representable finite floating-point number, e_max<br class=""><br class="">while e_max was first introduced in the floating-point model, i.e.<br class="">for *normalized* numbers. A solution would be to introduce<br class=""><br class="">  FLT_NORM_MAX_EXP<br class="">  DBL_NORM_MAX_EXP<br class="">  LDBL_NORM_MAX_EXP<br class=""><br class="">which would follow the floating-point model, and<br class=""><br class="">  FLT_MAX_EXP<br class="">  DBL_MAX_EXP<br class="">  LDBL_MAX_EXP<br class=""><br class="">which would allow potentially larger values, possibly with a relaxed<br class="">definition (the current one is OK when there are no supernormal numbers,<br class="">but may be artificial otherwise).<br class=""></div></div></blockquote><div><br class=""></div>I believe “floating-point number” was originally intended to refer to a model number. 5.2.4.2.2 still says that clearly:<br class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div>For each floating-point type, a<i class=""> floating-point number</i> (<i class="">x</i>) is defined by the following model:</div></blockquote><div><br class="">An implementation could include other values in floating types, but defining and describing how such values fit into the specification for model numbers would be the implementation’s job. </div><div><br class=""></div><div>However, it’s easy and natural to interpret “floating-point number” as any number in a floating type. And efforts to support double-double formats have used that interpretation, e.g., in the definitions of FLT_MAX and FLT_NORM_MAX.<br class=""><br class="">So what is a floating-point number? A number defined by the model, or a number in a floating type? Or is it one or the other depending on context?<br class=""><br class="">What’s feasible for CFP to do about this?</div><div><br class=""></div><div>- Jim Thomas</div><div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">FYI, my original GCC bug report (submitted before the defect report,<br class="">thus be careful with some obsolete discussion):<br class=""><br class="">  <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61399" class="">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61399</a><br class=""><br class="">-- <br class="">Vincent Lefèvre <<a href="mailto:vincent@vinc17.net" class="">vincent@vinc17.net</a>> - Web: <<a href="https://www.vinc17.net/" class="">https://www.vinc17.net/</a>><br class="">100% accessible validated (X)HTML - Blog: <<a href="https://www.vinc17.net/blog/" class="">https://www.vinc17.net/blog/</a>><br class="">Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)<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=""></div></div></blockquote></div><br class=""></body></html>