Last Update: 6:30pm, Friday, 1/21
Please note: with the Microsoft .NET compiler, you must #include <cfloat> in order to access DBL_MAX. It is apparently not in the .NET version of the <climits> library.
The final spec includes exact formulas for arithmetic and geometric sums, and an approximation for polynomial sums with unit base increment (only). You are not required to print out predicted values of sums and/or the error in an approximation to a sum. However, to verify the correctness of your program, you should compare your output to the values predicted by the formulas.
To avoid generating any sums beyond DBL_MAX, keep comparing the next term to DBL_MAX - sum, where sum is your running total. If the next term ever exceeds this bound, then print an error message and don't try to compute the total.
Avoiding overflow in the calculation of the next term is similar.
Thanks for pointing this out. You're right about needing <cfloat> in MSVC++.NET. (I had tested some code on a UNIX platform that also found DBL_MAX in <climits>. But the .NET compiler apparently doesn't find it there.)