Rev Language Reference


sum - Sum function

Sums all members of a vector of type `Real`, `RealPos`, `Integer`, or `Natural`

Usage

sum(Real[] x)

Arguments

x : Real[] (pass by const reference)
A vector of numbers.

Return Type

Example

a = v(1,2,3,4,5,6,7,8)
sum(a)
# returns 36