sum -- the sum of the elements of a list |
Syntax |
sum(L: LIST): OBJECT sum(L: LIST, InitVal: OBJECT): OBJECT |
Description |
Example |
/**/ use R ::= QQ[x,y]; /**/ sum([3, x, y^2]); y^2 +x +3 /**/ sum(1..40) = binomial(41,2); true /**/ sum(["c","oc","oa"]); cocoa /**/ sum([], ""); -- gives empty STRING /**/ sum([], zero(R)); -- gives type RINGELEM 0 |
See Also |