Change sum and product to work on doubles.  Add sumi and producti for integers.