<doc>
  <legacy_id>1060</legacy_id>
  <name>sum</name>
  <type>function</type>
  <syntax>
    <example>sum(<i>numbersList</i>)</example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
  </classification>
  <references>
    <operator tag="+">+ Operator</operator>
    <command tag="add">add Command</command>
    <function tag="max">max Function</function>
    <function tag="min">min Function</function>
    <function tag="standardDeviation">standardDeviation Function</function>
    <function tag="extents">extents Function</function>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
    <changed version="1.1"></changed>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary><glossary tag="return">Returns</glossary> the sum of a list of numbers.</summary>
  <examples>
    <example>sum(1,5,2,3) <code><i>-- returns 11</i></code></example>
  </examples>
  <description>
    <p>Use the <b>sum</b> function to add a <command tag="group">group</command> of <glossary tag="value">values</glossary> together.</p><p/><p><b>Parameters:</b></p><p/>The <i>numberList</i> is
<p>* a sequence of parameters, each a number or evaluating to a number or </p><p>* a single parameter which is or <glossary tag="evaluate">evaluates</glossary> to </p><p>* a comma-separated list of numbers or </p><p>* an array containing only numbers </p><p/><p><b>Value:</b></p><p>The <b>sum</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> a number.</p><p/><p><b>Comments:</b></p><p>The <b>sum</b> <control_st tag="function">function</control_st> is equivalent to the following <glossary tag="statement">statements</glossary>:</p><p/><p><code>  repeat with x = 1 to the number of items of numbersList</code></p><p><code>    add item x of numbersList to sumValue</code></p><p><code>  end repeat</code></p><p><code>  return sumValue</code></p><p/><p>If the <i>numbersList</i> is empty, the <b>sum</b> <control_st tag="function">function</control_st> returns zero.</p><p/><p><b>Changes:</b></p><p>The ability to use an array was introduced in version 1.1. In previous versions, only lists of numbers could be used with the <b>sum</b> <control_st tag="function">function</control_st>.</p>
  </description>
</doc>