Computes the product of an array of numbers.