A .sum()

Read(144) Label: sequence, sum,

Description:

Compute the sum of members of a sequence.

Syntax:

A.sum()

Equivalent to sum(x1,…,xn)

Note:

  The function computes the sum of members in sequence A; skip those members that are not numerical values.

Parameters:

A

A sequence

Return value:

The sum of all members in sequence A

Special Note:

  Take a null value as zero

Example:

 

A

 

1

=[1,2,3,4].sum()

10

2

=[2,null,3,4].sum()

9  Take the null value as zero

3

=[2, 3,4,"2323ads"].sum()

9  Ignore the non-numerical members

 

4

=sum(1,2,3,4)

10

Related functions:

A.count()

A.avg()

A.min()

A.max()

 

A.sum(x)