Sum: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(3 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
SUM(<numeric array>) | |||
The '''Sum''' [[internal function]] returns the sum of all the elements in the [[numeric]] [[array]] named. | |||
SUM also works with multi-dimensional matrices. | |||
====Comments and Examples==== | ====Comments and Examples==== | ||
00010 DIM X(8) | 00010 DIM X(8) | ||
00020 DATA 2,5,3,4,6,3,4,5 | 00020 DATA 2,5,3,4,6,3,4,5 | ||
Line 12: | Line 14: | ||
Line 40 will print 32, which is the total of the elements of array X. | Line 40 will print 32, which is the total of the elements of array X. | ||
==== | ====Related==== | ||
*[[AIDX]] | *[[AIDX]] | ||
*[[DIDX]] | *[[DIDX]] | ||
*[[UDIM]] | *[[UDIM]] | ||
*[[MAT]] | *[[MAT]] | ||
====See Also==== | |||
[[Sort Facility#SUM|Sort Control File Parameter SUM]] | |||
<noinclude> | <noinclude> | ||
[[Category:Internal Functions]] | [[Category:Internal Functions]] | ||
</noinclude> | </noinclude> |
Latest revision as of 03:15, 22 May 2014
SUM(<numeric array>)
The Sum internal function returns the sum of all the elements in the numeric array named.
SUM also works with multi-dimensional matrices.
Comments and Examples
00010 DIM X(8) 00020 DATA 2,5,3,4,6,3,4,5 00030 READ MAT X 00040 PRINT SUM(X)
Line 40 will print 32, which is the total of the elements of array X.