product

calculate the product of all values in given list


Parameters

product collection :block :range

Attributes

cartesianreturn the cartesian product of given sublists

Returns

  • :integer
  • :floating
  • :rational

Examples

copy
print product [3 4] ; 12 print product [1 2 4 6] ; 48 print product [] ; 1

copy
print product 1..10 ; 3628800

copy
product.cartesian [[A B C][D E]] ; => [[A D] [A E] [B D] [B E] [C D] [C E]]

Related