Note that coder1's factorial calculation will only be accurate when x is a positive integer less than or equal to 12 on many platforms, given the limited range of values that an int can hold.
EDIT: Using an unsignedlonglong with MS Visual C++ 2010's compiler bought me enough room to get accurately to 20!
The factorial can only be computed manually, no ready function to use.
If by this you mean there is no function in the STL I believe you are correct, but if you mean you can't have a function that find a factorial you are not correct. You can find a factorial pretty easy by using recursion. I believe there might also be one in the boost library also but I'm not sure.
Often when calculating the sum of a series, it isn't necessary to calculate the complete factorial each time. Usually, there is a simple relationship between successive terms of the series. Just one or two multiplications or divisions are sufficient to derive each term from the previous one.
I don't know whether the original question in this thread is intended to use that particular series - superficially it is different, but I'm wondering whether there is an error in the question?
If by this you mean there is no function in the STL I believe you are correct, but if you mean you can't have a function that find a factorial you are not correct.
yes, in STL i mean.
the code i wrote can be easily made as a function.