Skip to content

Total ​

The sum of the elements of a list; a matrix totals column by column.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageTotal✓
Total(list)x1+x2+⋯+xnx_1 + x_2 + \cdots + x_n for the nn elements of listlist.
Typed signatures
TypePackageApplies
(collection<any>) -> anycombinatoricsalways

Domain: Collections

Details
  • Wolfram's levels and Method arguments are not implemented.

Examples

Basic #
live ↗
InTotal([1,2,3])\mathrm{Total}(\bigl\lbrack1, 2, 3\bigr\rbrack)Out66

A matrix totals column by column

live ↗
InTotal([[1,2],[3,4]])\mathrm{Total}(\bigl\lbrack\bigl\lbrack1, 2\bigr\rbrack, \bigl\lbrack3, 4\bigr\rbrack\bigr\rbrack)Out[4,6]\bigl\lbrack4, 6\bigr\rbrack
live ↗
InTotal([a,b,c])\mathrm{Total}(\bigl\lbrack a, b, c\bigr\rbrack)Outa+b+ca+b+c
About
Examples3
Checked againstWolfram Language 3 agree
CrosswalkWolfram Language

See also: Mean, MovingMap