Computes the sum of an array of numbers.