@@ -9701,16 +9701,17 @@ <h5>Sum</h5>
9701
9701
be 6.0 (float).</p>
9702
9702
<div class="defn">
9703
9703
<p><b>Definition: <span id="defn_aggSum">Sum</span></b></p>
9704
- <pre class="code nohighlight">numeric Sum(sequence S)</pre>
9705
- <p>L = Flatten(S)</p>
9706
- <p>Sum(S) = Sum(L)</p>
9707
- <p>Sum(L) = op:numeric-add(L<sub>1</sub>, Sum(L<sub>2..n</sub>)) if <a href="#defn_Card">Card</a>(L) >
9704
+ <pre class="code nohighlight">numeric <var>Sum</var>(sequence <var>S</var>)</pre>
9705
+ <p>|Sum|(|S|) = <var>Sum'</var>(|L|),
9706
+ where |L| = Flatten(|S|)
9707
+ and <var>Sum'</var>(|L|) is defined recursively as follows.</p>
9708
+ <p><var>Sum'</var>(|L|) = op:numeric-add(|L|<sub>1</sub>, <var>Sum'</var>(|L|<sub>2..n</sub>)) if <a href="#defn_Card">Card</a>(|L|) >
9708
9709
1<br>
9709
- Sum(L) = op:numeric-add(L<sub>1</sub>, 0) if <a href="#defn_Card">Card</a>(L) = 1<br>
9710
- Sum(L) = "0"^^xsd:integer if <a href="#defn_Card">Card</a>(L) = 0</p>
9711
- <p>In this way, Sum( (1, 2, 3) ) = op:numeric-add(1, op:numeric-add(2,
9712
- op:numeric-add(3, 0))).</p>
9710
+ <var>Sum'</var>(|L|) = op:numeric-add(|L|<sub>1</sub>, 0) if <a href="#defn_Card">Card</a>(|L|) = 1<br>
9711
+ <var>Sum'</var>(|L|) = "0"^^xsd:integer if <a href="#defn_Card">Card</a>(|L|) = 0</p>
9713
9712
</div>
9713
+ <p>In this way, <var>Sum</var>( [(1), (2), (3)] ) = <var>Sum'</var>( (1, 2, 3) ) =
9714
+ op:numeric-add(1, op:numeric-add(2, op:numeric-add(3, 0))).</p>
9714
9715
</section>
9715
9716
<section id="aggAvg">
9716
9717
<h5>Avg</h5>
0 commit comments