Provides a method to compute a sum incrementally.