Sum: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
m (moved Sum to SUM)
No edit summary
Line 2: Line 2:
  Sum(num-array)
  Sum(num-array)


The '''Sum''' [[internal function]] returns the sum of all the elements in the [[numeric]] [[array]] named; also works with matrices (more than one dimension).
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 15:
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.


====See Also:====
====Related====
 
*[[AIDX]]
*[[AIDX]]
*[[DIDX]]
*[[DIDX]]

Revision as of 12:55, 30 January 2012

Sum(num-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.

Related