Skip to content
Prev 78583 / 398502 Next

Applying a function to each element of an array

The sum in the loop is simply:  2 - (0.5)^count.  

So you don't need this loop.  As "count" gets large, the sum approaches 2.

Ravi.