sum

∑

calculate the sum of all values in given list


Parameters

sum collection :block :range

Returns

  • :integer
  • :floating

Examples

copy
print sum [3 4] ; 7 print sum [1 2 4 6] ; 13

copy
print sum 1..10 ; 55

Related