Previous Up Next

6.3.26  Cumulated sum of the elements of a list

The cumSum command finds the partial sums of a list or sequence.

Examples

cumSum(sqrt(2),3,4,5,6)
     
√
2
,√
2
+3,√
2
+3+4,√
2
+3+4+5,√
2
+3+4+5+6
          
normal(cumSum(sqrt(2),3,4,5,6))
     
√
2
,√
2
+3,√
2
+7,√
2
+12,√
2
+18
          
cumSum(1.2,3,4.5,6)
     
1.2,4.2,8.7,14.7           
cumSum([0,1,2,3,4])
     
⎡
⎣
0,1,3,6,10⎤
⎦
          
cumSum("a","b","c","d")
     
“a”,“ab”,“abc”,“abcd”           
cumSum(["a","ab","abc","abcd"])
     
⎡
⎣
“a”,“aab”,“aababc”,“aababcabcd”⎤
⎦
          

Previous Up Next