sum

sum(a, b, c, ...)

sum(A)

sum(A, dimension)

Try it yourself:


sum(): add collection values

sum(values) adds the entries in a collection. It is the basic aggregate for totals, weighted calculations, and normalization.

Examples

sum([2, 4, 6]) is 12. In a matrix workflow, check which dimension is being aggregated so a row total is not mistaken for a whole-matrix total.

Related summaries

Divide a sum by a count with mean(), inspect extremes with min() and max(), and measure spread with variance(). Use size() to confirm collection shape.

Caveat

Validate that entries are finite numeric values; a missing or exceptional value can spoil a total.

Try Sum in Calcul.io

Start with one of the editable examples above, then replace its arguments with your own values. Keeping the function on a separate calculator line makes the input and result easy to compare. For a longer workflow, assign the result to a variable or reference that line in the next expression.

Check the shown signature before adding optional arguments, and use the related-function links to compare operations with similar purposes.

All functions