CVS difference for ai22s/ai22-0057-1.html

Differences between 1.1 and version 1.2
Log of other versions for file ai22s/ai22-0057-1.html

--- ai22s/ai22-0057-1.html	2023/01/12 08:53:19	1.1
+++ ai22s/ai22-0057-1.html	2023/06/06 06:07:33	1.2
@@ -1,34 +1,23 @@
-<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><title>AI22-0057-1/01</title>
+<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><title>AI22-0057-1/02</title>
 <style type="text/css">
 table td,table th{padding:0}
-.c30{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:0pt;border-right-width:0pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:0pt;border-top-style:solid;background-c
olor:#f0f0f0;border-left-style:solid;border-bottom-width:0pt;width:396pt;border-top-color:#000000;border-bottom-style:solid}
-.c25{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:0pt;border-right-width:0pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:0pt;border-top-style:solid;background-c
olor:#f0f0f0;border-left-style:solid;border-bottom-width:0pt;width:468pt;border-top-color:#000000;border-bottom-style:solid}
-.c24{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:0pt;border-right-width:0pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:0pt;border-top-style:solid;background-c
olor:#f0f0f0;border-left-style:solid;border-bottom-width:0pt;width:395.2pt;border-top-color:#000000;border-bottom-style:solid}
-.c7{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:0pt;border-right-width:0pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:0pt;border-top-style:solid;background-co
lor:#f0f0f0;border-left-style:solid;border-bottom-width:0pt;width:393pt;border-top-color:#000000;border-bottom-style:solid}
-.c13{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:0pt;border-right-width:0pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:0pt;border-top-style:solid;background-c
olor:#f0f0f0;border-left-style:solid;border-bottom-width:0pt;width:389.2pt;border-top-color:#000000;border-bottom-style:solid}
-.c29{border-right-style:solid;padding:5pt 5pt 5pt 5pt;border-bottom-color:#000000;border-top-width:0pt;border-right-width:0pt;border-left-color:#000000;vertical-align:top;border-right-color:#000000;border-left-width:0pt;border-top-style:solid;background-c
olor:#f0f0f0;border-left-style:solid;border-bottom-width:0pt;width:394.5pt;border-top-color:#000000;border-bottom-style:solid}
-.c10{margin-left:73.5pt;border-spacing:0;border-collapse:collapse;margin-right:auto}
-.c17{margin-left:78.8pt;border-spacing:0;border-collapse:collapse;margin-right:auto}
-.c11{margin-left:75pt;border-spacing:0;border-collapse:collapse;margin-right:auto}
-.c9{border-spacing:0;border-collapse:collapse;margin-right:auto}
-.c31{margin-left:72pt;border-spacing:0;border-collapse:collapse;margin-right:auto}
-.c27{margin-left:72.8pt;border-spacing:0;border-collapse:collapse;margin-right:auto}
-.c23{background-color:#ffffff;max-width:468pt;padding:72pt 72pt 72pt 72pt}
-.c16{height:0pt}
+BODY.body{background-color:#ffffff; max-width:468pt; padding:72pt 72pt 72pt 72pt}
 P.head{margin-bottom:0; margin-top:0; margin-left:0; margin-right:0; padding-top:0pt; color:#000000; font-size:14pt; padding-bottom:0pt; font-family:"Arial","Liberation Sans",sans-serif; line-height:1.15; orphans:2; widows:2; text-align:left; font-weight:
400; text-decoration:none; vertical-align:baseline; font-style:normal}
 H2.head{margin-bottom:0; margin-top:0; margin-left:0; margin-right:0; padding-top:12pt; color:#000000; font-size:14pt; padding-bottom:6pt; font-family:"Arial","Liberation Sans",sans-serif; line-height:1.15; page-break-after:avoid; orphans:2; widows:2; tex
t-align:left; font-weight:400; text-decoration:none; vertical-align:baseline; font-style:normal}
 P.inst{margin-bottom:0; margin-top:0; margin-left:18pt; margin-right:0; padding-top:9pt; color:#000000; font-size:12pt; padding-bottom:6pt; font-family:"Arial","Liberation Sans",sans-serif;line-height:1.15; orphans:2; widows:2; text-align:left; font-weigh
t:400; text-decoration:none; vertical-align:baseline; font-style:normal}
 P.word{margin-bottom:0; margin-top:0; margin-left:36pt; margin-right:0; padding-top:0pt; color:#000000; font-size:11pt; padding-bottom:3pt; font-family:"Times New Roman","Times",serif; line-height:1.15; orphans:2; widows:2; text-align:left; font-weight:40
0; text-decoration:none; vertical-align:baseline; font-style:normal}
 P.wrds{margin-bottom:0; margin-top:0; margin-left:36pt; margin-right:0; padding-top:0pt; color:#000000; font-size:11pt; padding-bottom:12pt; font-family:"Times New Roman","Times",serif; line-height:1.15; orphans:2; widows:2; text-align:left; font-weight:4
00; text-decoration:none; vertical-align:baseline; font-style:normal}
-P.codt{margin-bottom:0; margin-top:0; margin-left:0; margin-right:0; padding-top:0pt; color:#000000; font-size:10pt; padding-bottom:0pt; font-family:"Courier New",monospace; line-height:1.15; text-align:left; background-color:#f0f0f0; font-weight:400; tex
t-decoration:none; vertical-align:baseline; font-style:normal}
+P.codb{margin-bottom:0; margin-top:0; margin-left:12pt; margin-right:0; padding-left:4pt; padding-top:4pt; color:#000000; font-size:10pt; padding-bottom:4pt; font-family:"Courier New",monospace; line-height:1.15; text-align:left; background-color:#f0f0f0;
 font-weight:400; text-decoration:none; vertical-align:baseline; font-style:normal}
+P.cbi3{margin-bottom:0; margin-top:0; margin-left:84pt; margin-right:0; padding-left:4pt; padding-top:4pt; color:#000000; font-size:10pt; padding-bottom:4pt; font-family:"Courier New",monospace; line-height:1.15; text-align:left; background-color:#f0f0f0;
 font-weight:400; text-decoration:none; vertical-align:baseline; font-style:normal}
 P.text{margin-bottom:0; margin-top:0; margin-left:0; margin-right:0; padding-top:0pt; color:#000000; font-size:11pt; padding-bottom:0pt; font-family:"Arial","Liberation Sans",sans-serif; line-height:1.15; text-align:left; font-weight:400; text-decoration:
none; vertical-align:baseline; font-style:normal}
 P.txts{margin-bottom:0; margin-top:0; margin-left:0; margin-right:0; padding-top:0pt; color:#000000; font-size:11pt; padding-bottom:11pt; font-family:"Arial","Liberation Sans",sans-serif; line-height:1.15; text-align:left; font-weight:400; text-decoration
:none; vertical-align:baseline; font-style:normal}
-P.a0{margin-bottom:0; margin-top:0; margin-left:0; margin-right:0;color:#000000;font-size:26pt;font-family:"Arial","Liberation Sans",sans-serif; orphans:2; widows:2; padding-top:0pt; padding-bottom:3pt; line-height:1.15; page-break-after:avoid; text-align
:left; font-weight:400; text-decoration:none; vertical-align:baseline; font-style:normal}
+P.inds{margin-bottom:0; margin-top:0; margin-left:24pt; margin-right:0; padding-top:0pt; color:#000000; font-size:11pt; padding-bottom:11pt; font-family:"Arial","Liberation Sans",sans-serif; line-height:1.15; text-align:left; font-weight:400; text-decorat
ion:none; vertical-align:baseline; font-style:normal}
+P.l3h{margin-bottom:0; margin-top:0; margin-left:0; margin-right:0;color:#000000;font-size:26pt;font-family:"Arial","Liberation Sans",sans-serif; padding-top:0pt; padding-bottom:3pt; line-height:1.15; page-break-after:avoid; orphans:2; widows:2; text-alig
n:left; font-weight:400; text-decoration:none; vertical-align:baseline; font-style:normal}
 </style>
-</head><body class="c23 doc-content"><p class="a0">AI22-0057-1</p>
+</head><body class="body"><p class="l3h">AI22-0057-1</p>
 <p class="head">!standard A.5.4(4) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;23-01-11
-&nbsp;AI22-0057-1/01</p>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;23-06-02
+&nbsp;AI22-0057-1/02</p>
 <p class="head">!class Amendment 23-01-11</p>
 <p class="head">!status work item 23-01-11</p>
 <p class="head">!status received 23-01-11</p>
@@ -40,7 +29,7 @@
 <h2 class="head">!issue</h2>
 <p class="text">There is a growing interest in fixed-point with the emergence of machine learning
 and GPUs. It is nice if an algorithm can be moved between fixed and float without significant
-re-engineering. However, the attributes Floor Ceiling, Rounding, Unbiased_Rounding,
+re-engineering. However, the attributes Floor, Ceiling, Rounding, Unbiased_Rounding,
 Machine_Rounding, and Truncation are missing for fixed point types. This forces unnecessary
 conversions to floating point types, which can themselves introduce rounding effects.</p>
 <h2 class="head">!recommendation</h2>
@@ -48,40 +37,38 @@
 <h2 class="head">!wording</h2>
 <p class="inst">Add after A.5.4(4):</p>
 
-<p class="wrds">A fixed point type <i>has integral values</i> if its Small value is an integral
-value or if a multiple of the Small value is an integral value. A generic formal type is defined to
-have integral values.</p>
+<p class="wrds">A fixed point type <i>has integral values</i> if its Small value is an integer or
+the reciprocal of an integer. A generic formal type is defined to have integral values.</p>
 
+<p class="inds">[Author&rsquo;s note: This wording echoes that of G.2.3(21/5); that wording dates
+to Ada 95.]</p>
+
 <p class="wrds">The following primitive function attributes are defined for any subtype S of a
 fixed point type T that has integral values:</p>
 
 <p class="word">S&#39;Ceiling</p>
 <p class="wrds">S&#39;Ceiling denotes a function with the following specification:</p>
 
-<a id="t.ec625c23b9ef7456179f527fb8a97a36c047f1bd"></a><a id="t.0"></a><table class="c11"><tr class="c16"><td class="c7">
-<p class="codt"><b>function</b> S&#39;Ceiling (X : T)<br>
- &nbsp;<b>return</b> T</p>
-</td></tr></table><p class="word">&nbsp;</p>
+<p class="cbi3"><b>function</b> S&#39;Ceiling (X : T)<br>
+&nbsp; <b>return</b> T</p>
+<p class="word">&nbsp;</p>
 <p class="wrds">The function yields the value <i>Ceiling(X)</i>, that is, the smallest (most
-negative) integral value greater than or equal to X. If T is a generic formal type, S&#39;Ceiling
-raises Program_Error if the actual subtype does not have integral values.</p>
+negative) integral value greater than or equal to X.</p>
 
 <p class="word">S&#39;Floor</p>
 <p class="wrds">S&#39;Floor denotes a function with the following specification:</p>
 
-<a id="t.3d4e3916d0f7955c06377edda8181a54b0cf5d51"></a><a id="t.1"></a><table class="c17"><tr class="c16"><td class="c13">
-<p class="codt"><b>function</b> S&#39;Floor (X : T)<br>
- &nbsp;<b>return</b> T</p>
-</td></tr></table><p class="wrds">The function yields the value <i>Floor(X)</i>, that is, the
-largest (most positive) integral value less than or equal to X.</p>
+<p class="cbi3"><b>function</b> S&#39;Floor (X : T)<br>
+&nbsp; <b>return</b> T</p>
+<p class="wrds">The function yields the value <i>Floor(X)</i>, that is, the largest (most positive)
+integral value less than or equal to X.</p>
 
 <p class="word">S&#39;Rounding</p>
 <p class="wrds">S&#39;Rounding denotes a function with the following specification:</p>
 
-<a id="t.53acccc53dcd5e5c94039ba32d4b75bbc58c73df"></a><a id="t.2"></a><table class="c27"><tr class="c16"><td class="c24">
-<p class="codt"><b>function</b> S&#39;Rounding (X : T)<br>
- &nbsp;<b>return</b> T</p>
-</td></tr></table><p class="word">&nbsp;</p>
+<p class="cbi3"><b>function</b> S&#39;Rounding (X : T)<br>
+&nbsp; <b>return</b> T</p>
+<p class="word">&nbsp;</p>
 <p class="wrds">The function yields the integral value nearest to X, rounding away from zero if X
 lies exactly halfway between two integers.</p>
 
@@ -89,20 +76,18 @@
 
 <p class="wrds">S&#39;Unbiased_Rounding denotes a function with the following specification:</p>
 
-<a id="t.7eac348bb96e607b7904b5308bea0dc3ad152aca"></a><a id="t.3"></a><table class="c27"><tr class="c16"><td class="c24">
-<p class="codt"><b>function</b> S&#39;Unbiased_Rounding (X : T)<br>
- &nbsp;<b>return</b> T</p>
-</td></tr></table><p class="word">&nbsp;</p>
+<p class="cbi3"><b>function</b> S&#39;Unbiased_Rounding (X : T)<br>
+&nbsp; <b>return</b> T</p>
+<p class="word">&nbsp;</p>
 <p class="wrds">The function yields the integral value nearest to X, rounding toward the even
 integer if X lies exactly halfway between two integers.</p>
 
 <p class="wrds">S&#39;Machine_Rounding</p>
 
 <p class="word">S&#39;Machine_Rounding denotes a function with the following specification:</p>
-<a id="t.cbe2171b4472cf0f394ea984361fdb1458fb2ce2"></a><a id="t.4"></a><table class="c10"><tr class="c16"><td class="c29">
-<p class="codt"><b>function</b> S&#39;Machine_Rounding (X : T)<br>
- &nbsp;<b>return</b> T</p>
-</td></tr></table><p class="word">&nbsp;</p>
+<p class="cbi3"><b>function</b> S&#39;Machine_Rounding (X : T)<br>
+&nbsp; <b>return</b> T</p>
+<p class="word">&nbsp;</p>
 <p class="wrds">The function yields the integral value nearest to X. If X lies exactly halfway
 between two integers, one of those integers is returned, but which of them is returned is
 unspecified. This function provides access to the rounding behavior which is most efficient on the
@@ -116,10 +101,9 @@
 <p class="word">S&#39;Truncation</p>
 <p class="wrds">S&#39;Truncation denotes a function with the following specification:</p>
 
-<a id="t.10e9a4ac4f9c63f37cd5d9f137b57a6b8489e2cc"></a><a id="t.5"></a><table class="c31"><tr class="c16"><td class="c30">
-<p class="codt"><b>function</b> S&#39;Truncation (X : T)<br>
- &nbsp;<b>return</b> T</p>
-</td></tr></table><p class="word">&nbsp;</p>
+<p class="cbi3"><b>function</b> S&#39;Truncation (X : T)<br>
+&nbsp; <b>return</b> T</p>
+<p class="word">&nbsp;</p>
 <p class="wrds">The function yields the value Ceiling(X) when X is negative, and Floor(X)
 otherwise.</p>
 
@@ -143,22 +127,20 @@
 nonsense results for types that cannot exactly represent integers.</p>
 
 <p class="text">For instance, for a type defined:</p>
-<a id="t.fcac029e0900fb9af31ee2a74bd1bb1a8ced258b"></a><a id="t.6"></a><table class="c9"><tr class="c16"><td class="c25">
-<p class="codt"><b>type</b> Foobar <b>is</b> <b>delta</b> 0.7 <b>range</b> 0.0 .. 7.0 <b>with</b>
+<p class="codb"><b>type</b> Foobar <b>is</b> <b>delta</b> 0.7 <b>range</b> 0.0 .. 7.0 <b>with</b>
 Small =&gt; 0.7;</p>
-</td></tr></table><p class="txts">Foobar&#39;Floor(1.4) = 0.7 (as 0.7 is the nearest model number
-to 1.0). But these functions are defined to return &quot;integral values&quot;, and it takes a
-strong imagination to see 0.7 as an integral value.</p>
+<p class="txts">Foobar&#39;Floor(1.4) = 0.7 (as 0.7 is the nearest model number to 1.0). But these
+functions are defined to return &quot;integral values&quot;, and it takes a strong imagination to
+see 0.7 as an integral value.</p>
 
 <p class="txts">Worse, in the worst case, this issue can destroy one of the primary purposes of the
 rounding attributes: to specify how a value gets rounded to an integer value.</p>
 
-<a id="t.e249044e84457c47b8005ddf3e2a4ea9d570299a"></a><a id="t.7"></a><table class="c9"><tr class="c16"><td class="c25">
-<p class="codt"><b>type</b> Horrible <b>is</b> <b>delta</b> 2.5 <b>range</b> -10.0 .. 10.0
+<p class="codb"><b>type</b> Horrible <b>is</b> <b>delta</b> 2.5 <b>range</b> -10.0 .. 10.0
 <b>with</b> Small =&gt; 2.5;<br>
 Obj : Horrible := 2.5;<br>
 A : Integer := Integer(Horrible&#39;Floor(Obj));</p>
-</td></tr></table><p class="text">&nbsp;</p>
+<p class="text">&nbsp;</p>
 <p class="txts">The purpose of this expression is to ensure that 2.5 rounds down so that A = 2. But
 here, the result of Horrible&#39;Floor(Obj) would be 2.5, meaning that the default rounding of the
 integer conversion would be used - which is defined by 4.6(33) as round away from zero. Thus A will
@@ -169,7 +151,7 @@
 
 <p class="text">An alternative to making these attributes illegal in this case would be to define
 them as returning <i>Universal_Integer</i> rather than the fixed point type itself. However, this
-would make them different than the corresponding float attributes. Additionally, implementing these
+would make them different from the corresponding float attributes. Additionally, implementing these
 attributes exactly as required would be problematic for some types that do not have integral
 values.</p>
 <h2 class="head">!ACATS test</h2>

Questions? Ask the ACAA Technical Agent