up previous next
Product, Sum

the product or sum of the elements of a list

Syntax
Product(L:List):OBJECT
Sum(L:List):OBJECT

Description
These functions return the product and sum, respectively, of the objects in the list L.

Example
Use R ::= Q[x,y];
Product([3,x,y^2]);
3xy^2
-------------------------------
Sum([3,x,y^2]);
y^2 + x + 3
-------------------------------
Product(1..40)=Fact(40);
TRUE
-------------------------------
Sum(["c","oc","oa"]);
cocoa
------------------------------- 


See Also