From: Phrogz Date: 2007-01-24T01:25:10+09:00 Subject: Re: Multiplying array WKC CCC wrote: > Does anyone know of a function that multiplies the contents of an array. module Enumerable def product inject{ |piece, prod| prod*piece } end def sum inject(0){ |piece, total| total+piece } end end a = (1..10) p a.sum #=> 55 p a.product #=> 3628800