Keith Thompson said the following, on 04/29/04 17:47:
(e-mail address removed) (Rob Thorpe) writes:
[...]
An infinite sum is a mathematical idea. In general, it can't be
calculated precisely without using analysis. It could be done
approximately by using a large number of interations of a floating
point calculation, but this wouldn't work well, in some cases. An
integer based calculation would not work, in general.
And yet <math,h> declares a number of functions that are (or can be)
defined in terms of infinite sums. It's often possible to compute
such functions to as much precision (and accuracy!) as needed.
We are wandering rather OT for this group, but I think you (and James
Hu) are missing the point that Rob is making.
I don't think I missed Rob's point. Apparently you and Rob did
not read the word "approximation" in my post.
Certainly analysis can determine whether or not a particular
series is convergent or divergent, and can sometimes yield
a closed form. However, the original poster did not post
his true intent, so I felt free to apply an artistic license
to interpret the question that yielded a semi-topical answer.
Many numerical methods do rely on iteration of terms and testing
successive terms for convergence. Irregardless, if the OP wanted
a general symbolic math library, then this is the wrong newsgroup
to ask the question. If the poster wanted to know how to pass
a function that evaluates an expression to another function, then
I think my answer was spot on.
Now having said this, my first response to Rob's point was
half-way tounge in cheek, and apparently this point was also
lost since he snipped my signature in that post. I used the
term "sufficiently large MAX_INT", and I think that alone should
have clued readers in that I was not entirely serious.
-- James