@@ -9589,10 +9589,10 @@ <h5>Sum</h5>
9589
9589
<pre class="code nohighlight">numeric Sum(sequence S)</pre>
9590
9590
<p>L = Flatten(S)</p>
9591
9591
<p>Sum(S) = Sum(L)</p>
9592
- <p>Sum(L) = op:numeric-add(L<sub>1</sub>, Sum(L<sub>2..n</sub>)) when <a href="#defn_Card">Card</a>(L) >
9592
+ <p>Sum(L) = op:numeric-add(L<sub>1</sub>, Sum(L<sub>2..n</sub>)) if <a href="#defn_Card">Card</a>(L) >
9593
9593
1<br>
9594
- Sum(L) = op:numeric-add(L<sub>1</sub>, 0) when <a href="#defn_Card">Card</a>(L) = 1<br>
9595
- Sum(L) = "0"^^xsd:integer when <a href="#defn_Card">Card</a>(L) = 0</p>
9594
+ Sum(L) = op:numeric-add(L<sub>1</sub>, 0) if <a href="#defn_Card">Card</a>(L) = 1<br>
9595
+ Sum(L) = "0"^^xsd:integer if <a href="#defn_Card">Card</a>(L) = 0</p>
9596
9596
<p>In this way, Sum( (1, 2, 3) ) = op:numeric-add(1, op:numeric-add(2,
9597
9597
op:numeric-add(3, 0))).</p>
9598
9598
</div>
@@ -9604,8 +9604,8 @@ <h5>Avg</h5>
9604
9604
<div class="defn">
9605
9605
<p><b>Definition: <span id="defn_aggAvg">Avg</span></b></p>
9606
9606
<pre class="code nohighlight">numeric Avg(sequence S)</pre>
9607
- <p>Avg(S) = "0"^^xsd:integer, where Count(S) = 0</p>
9608
- <p>Avg(S) = Sum(S) / Count(S), where Count(S) > 0</p>
9607
+ <p>Avg(S) = "0"^^xsd:integer if Count(S) = 0</p>
9608
+ <p>Avg(S) = Sum(S) / Count(S) if Count(S) > 0</p>
9609
9609
</div>
9610
9610
<p>For example, Avg([(1), (2), (3)]) = Sum([(1), (2), (3)])/Count([(1), (2), (3)]) = 6/3 = 2.</p>
9611
9611
</section>
@@ -9654,11 +9654,11 @@ <h5>GroupConcat</h5>
9654
9654
be the "space" character, unicode codepoint U+0020.</p>
9655
9655
<p>L = Flatten(S)</p>
9656
9656
<p>GroupConcat(S, scalarvals) = GroupConcat(L, scalarvals("separator"))</p>
9657
- <p>GroupConcat(L, sep) = "", where <a href="#defn_Card">Card</a>(L) = 0</p>
9658
- <p>GroupConcat(L, sep) = CONCAT("", L<sub>0</sub>), where
9657
+ <p>GroupConcat(L, sep) = "" if <a href="#defn_Card">Card</a>(L) = 0</p>
9658
+ <p>GroupConcat(L, sep) = CONCAT("", L<sub>0</sub>) if
9659
9659
<a href="#defn_Card">Card</a>(L) = 1</p>
9660
9660
<p>GroupConcat(L, sep) = CONCAT(L<sub>0</sub>, sep, GroupConcat(L<sub>1..n-1</sub>,
9661
- sep)), where <a href="#defn_Card">Card</a>(L) > 1</p>
9661
+ sep)) if <a href="#defn_Card">Card</a>(L) > 1</p>
9662
9662
</div>
9663
9663
<p>For example, GroupConcat([("a"), ("b"), ("c")], {"separator" → "."}) = "a.b.c".</p>
9664
9664
</section>
0 commit comments