Synopsis:
product(v,f) -- yields the product of the expressions obtained by applying f to each of the elements of the list or sequence v.
i1 : product(1 .. 5, i -> i^2) |
See also:
Code:
-- ../../../Macaulay2/m2/lists.m2:76-82 product(ZZ,Function) := (n,f) -> ( s := 1; g := x -> ( s = f x; g = x -> s = s * f x); scan(n,x -> g x); s);